Distinguish between a default constructor and a parameterised constructor, and state what a copy constructor does.
Constructors
Original Khojo Papers practice question — not from a past board paper.
A constructor is a special member method that is invoked automatically when an object is created, and it initialises the object. It has the same name as the class, it has no return type, not even void, and it cannot be called explicitly like an ordinary method.
No citable source has been recorded for this record. Treat it as practice material, not as fact.
If no constructor is written, the compiler supplies a default one.
From the same topic and chapter, at a similar level.
Distinguish between a default constructor and a parameterised constructor, and state what a copy constructor does.
Constructors
State three differences between a constructor and a method.
Constructors
Write a class Rectangle with a parameterised constructor and a method to return its area.
Constructors
What is constructor overloading? Give one situation in which it is useful.
Constructors
Distinguish between a class and an object.
Introduction to Object-Oriented Programming
State the four principles of object-oriented programming and explain each in one sentence.
Introduction to Object-Oriented Programming