When does the compiler supply a default constructor for a
class?
Answer Posted / puneet
java follows the constructor chaining and whenever a class
in instantiated,the cons of the super class is always
invoked and to follow that when a class without contructor
is loaded then the compiler at the compiler gives it a
default constructor in order to help that make instantiated
and invoke the super class cons, it autmatically makes a
consturc at compile time and writes the first line as
super(); which invokes the super class constructor.
| Is This Answer Correct ? | 2 Yes | 0 No |
Post New Answer View All Answers
What is the purpose of default constructor?
Is java written in c?
What are the differences between c++ and java?
What is implicit object in java?
Does hashset allow duplicates in java?
What is the difference between private & public & friendly classes?
What is the difference between jfc & wfc?
In how many ways we can do synchronization in java?
Why is string class considered immutable?
What’s the difference between callable and runnable?
What is backdrop?
How many types of flags are there?
What is == in java?
What is java Applet?
What is the different between get and post?