What is the need for calling default constructor by JVM? why the JVM should intiializes default values to the data fields if the constructor is not there in our class?

Showing Answers 1 - 6 of 6 Answers

Raghava

  • Nov 20th, 2007
 

First, Let us understand the concept of construcotrs. The constructors are used to construct objects. This is the Only way to create object. If we did not write any constructor in our class, the compliler itself creates a dummy default constructor, which do not have parameters and code. When this dummy default constructor is executed the JVM initializes the instance variable by their default values.

  Was this answer useful?  Yes

sampra

  • Feb 14th, 2008
 

use of default constructor is to create the default object of type java.lang.Class which is done by JVM

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions