हिंदी

Explain the following term: Constructor with default argument - Computer Applications

Advertisements
Advertisements

प्रश्न

Explain the following term:

Constructor with default argument

लघु उत्तरीय

उत्तर

  1. 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. 
  2. For example, Employer em = new Employer(); 
shaalaa.com
  क्या इस प्रश्न या उत्तर में कोई त्रुटि है?
अध्याय 7: Constructors - EXERCISES [पृष्ठ ४१८]

APPEARS IN

अविचल Computer Applications [English] Class 10 ICSE
अध्याय 7 Constructors
EXERCISES | Q V. 4. (a) | पृष्ठ ४१८
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×