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
how we can make a read-only class in java?
What are structs in java?
What are the different types of garbage collectors in java?
Explain the difference between an Interface and an Abstract class?
What class of exceptions are generated by the java run-time system?
Explain the difference between throw and throws in java?
What is the file type?
How do you do math powers in java?
What is internal variable?
What restrictions are placed on method overriding in java programming?
What are the differences between this and super keyword?
How will you communicate between two applets?
What is getkey () in java?
What is difference between static variable and global variable?
What is the difference between multitasking and multithreading in Java