English

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

Advertisements
Advertisements

Question

Explain the following term:

Constructor with default argument

Short Answer

Solution

  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
  Is there an error in this question or solution?
Chapter 7: Constructors - EXERCISES [Page 418]

APPEARS IN

Avichal Computer Applications [English] Class 10 ICSE
Chapter 7 Constructors
EXERCISES | Q V. 4. (a) | Page 418
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×