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 formatted output in java?
What is constructor and virtual function? Can we call a virtual function in a constructor?
Define packages in java?
What is a java string?
What is variable declaration and definition?
What are the different access modifiers available in java?
What is singleton class and how can we make a class singleton?
How do you declare an empty string?
What does super keyword do?
What is a constructor overloading in java?
What is java beans?
Where are the local variables stored?
what are different ways in which a thread can enter the waiting state? : Java thread
What is visibility mode?
Can we return null in java?