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 api in java?
Why java is said to be pass-by-value ?
What are the basic interfaces of java collections framework?
Is string is a class in java?
Can we have return statement in finally clause? What will happen?
What is data type in java?
In how many ways we can do exception handling in java?
How many classes can any class inherit java?
How will you call an Applet using Java Script Function?
What is arguments in java?
What is an array length?
What are access specifiers in java ?
When do we use hashset over treeset?
What is meant by 'bit masking' in java?
How many bits is a char?