What is a default constructor? How are an object’s instance variables initialized if a class has only a default constructor?
What will be an ideal response?
A default constructor is provided by the compiler when you do not specify any con- structors in the class. When a class has only the default constructor, its instance variables are initialized to their default values. Variables of types char, byte, short, int, long, float and double are initialized to 0, variables of type boolean to false, and reference-type variables to null.
Computer Science & Information Technology
You might also like to view...
A(n) ________ is a flaw in programming
Fill in the blank(s) with correct word
Computer Science & Information Technology
Many systems force users to have their files organized for fixed-length records if the records are to be accessed directly.
Answer the following statement true (T) or false (F)
Computer Science & Information Technology