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
Explain the features of java?
Is it possible to override the main method?
What are the two main uses of volatile in Java?
What is the default value of local and global variables?
What does super keyword do?
What is the difference between scrollbar and scrollpane?
What is meant by stack and queue?
In which order the iterator iterates over collection?
What is the synchronized method modifier?
What is sortedmap interface?
What is the purpose of default constructor?
Can a class be protected in java?
Can we make a constructor final?
What are advantages and disadvantages of OOPs?
What is passed by reference and pass by value ?