![]() ![]() Important Note: Constructors are invoked only after the instance variables of a newly created object of the class have been assigned their default initial values and after their explicit initializers are executed. The default constructor looks like: public Rectangle() Its only purpose is to enable you to create object of class type. It does not contain any parameters and doesn’t even contain any statements in its body. So in such situations, the compiler automatically creates one constructor which is known as default constructor. But in some programs if we don’t create any constructor.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |