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 does null mean in java?
Hi all, I am dng a mini project on FileSplitter application which splits the GBs of logfile into Smaller chunks(mbs) depending on the split size." How to handle GBs file? I am getting OutOfMemoryException, when I input such GB sized file. Thx
Is main a function?
What is the maximum size of byte array in java?
which class is the wait() method defined in? : Java thread
What is a percentage sign called?
What is the difference between sleep and wait in java?
What are the two environment variables that must be set in order to run any java programs?
What is codebase?
Is null a keyword in java?
What is the purpose of interface?
How arrays are stored in memory in java?
when to use ArrayList and when to use HashMap in webApplication.
What about abstract classes in java?
What is quick sort in java?