in a constructor what happen if u call super and this in
the same class? i know that it is not possible to call
both in the same one? if we call what will happen?
Answer Posted / atul
class A
{
public A()
{ super();//this is perfect no error
super();//but this call generate RunTimeException
//because inside constructor super called
//must be in first called ok thats it
}
public static void main(String args[])
{
A a1=new A();
}
}
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
What is the function of log?
What is a singleton class? Give a practical example of its usage.
what is optional in java 8?
What is array pointers ?
What is immutable state?
Why strings in java are called as immutable?
what is object slice?
What is jit compiler in java?
What are the types of inner classes (non-static nested class) used in java?
Explain the difference between the public, private, final, protected, and default modifiers?
What is not object oriented programming?
What is the exact difference in between Unicast and Multicast object?
Which types of exceptions are caught at compile time?
What is a superclass?
What is method overriding in java ?