English

When a program does not contain any constructor, java compiler provides a ______ (default/parameterized) constructor.

Advertisements
Advertisements

Question

When a program does not contain any constructor, java compiler provides a ______ (default/parameterized) constructor.

Fill in the Blanks
Advertisements

Solution

When a program does not contain any constructor, java compiler provides a default constructor.

Explanation:

If you do not write any constructor in your class, the Java compiler automatically inserts an invisible, no-argument default constructor for you during compilation. This ensures that you can always create an instance of that class using the new keyword.

shaalaa.com
  Is there an error in this question or solution?
Chapter 4: Constructors - Exercises [Page 115]

APPEARS IN

Rupa Pandit Computer Applications [English] Class 10 ICSE
Chapter 4 Constructors
Exercises | Q 2. (v) | Page 115
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×