English

What is meant by a constructor? - Computer Applications

Advertisements
Advertisements

Question

What is meant by a constructor?

Short Answer

Solution

A constructor is a member method with the same name as the class. It initializes data members or instance variables and creates class objects. 

Example: Car ob = new Car();      
The statement invokes the Car class's default constructor.     

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. 1. | Page 418
Avichal Computer Applications [English] Class 10 ICSE
Chapter 7 Constructors
Review Insight | Q 9. (i) | Page 415
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×