Advertisements
Advertisements
प्रश्न
Explain the following term:
Constructor with default argument
लघु उत्तरीय
उत्तर
- A default constructor initializes instance variables with default values. When no program defines a constructor, the compiler builds one automatically. When a class object is formed, this constructor sets the instance variables to system-approved default values.
- For example, Employer em = new Employer();
shaalaa.com
क्या इस प्रश्न या उत्तर में कोई त्रुटि है?
अध्याय 7: Constructors - EXERCISES [पृष्ठ ४१८]