1.

What Is Default Constructors?

Answer»

When you CREATE your classes, you should always provide one or more CONSTRUCTOR methods. However, if you do not specify constructor, Java will provide a default constructor for you. Java's default constructor will ALLOCATE MEMORY to hold the object and will then initialize all instance variables to their DEFAULTS. Java will not provide a default constructor, however, if your class specifies one or more constructor for the class.

When you create your classes, you should always provide one or more constructor methods. However, if you do not specify constructor, Java will provide a default constructor for you. Java's default constructor will allocate memory to hold the object and will then initialize all instance variables to their defaults. Java will not provide a default constructor, however, if your class specifies one or more constructor for the class.



Discussion

No Comment Found