Which of the statement are CORRECT?

(A) Constructors are invoked automatically when the objects are created.

(B) Constructors do not have return types, not even void and therefore they cannot return values.

(C) Constructors cannot be inherited though a derived class can call the base class constructors.

(D) Constructors can be declared as virtual.

Choose the correct answer from the options given below:

This question was previously asked in
UGC NET Computer Science (Paper 2) 07 Dec 2023 Official Paper
View all UGC NET Papers >
  1. (A), (B) and (D) Only
  2. (A), (B) and (C) Only 
  3. (B), (C) and (D) Only
  4. (A), (C) and (D) Only

Answer (Detailed Solution Below)

Option 2 : (A), (B) and (C) Only 
Free
UGC NET Paper 1: Held on 21st August 2024 Shift 1
10.8 K Users
50 Questions 100 Marks 60 Mins

Detailed Solution

Download Solution PDF

The correct answer is (A), (B) and (C) Only 

EXPLANATION:

  • (A) Constructors are invoked automatically when the objects are created - Correct.
    • In object-oriented programming, a constructor is a special method that is automatically called when an object is created. Its purpose is to initialize the new object's attributes.
  • (B) Constructors do not have return types, not even void and therefore they cannot return values - Correct.
    • Constructors are primarily used to initialize object attributes. They do not return values, and specifying a return type for them can lead to compiler errors.
  • (C) Constructors cannot be inherited though a derived class can call the base class constructors - Correct.
    • An object of a subclass type will automatically call its superclass's constructor as part of its creation process, but the constructor itself isn't an inheritable part of the superclass.

  • (D) Constructors can be declared as virtual - Incorrect.
    • Virtuality applies to functions that you want to be executed polymorphically, where the specific implementation depends on the actual run-time type of the object.
    • Constructors don't work this way: when you create an object of a derived class, it's the derived constructor that you want to run.
    • The base class constructor is called automatically already, before the derived class constructor, so there is no need for virtuality.
Latest UGC NET Updates

Last updated on Jun 12, 2025

-> The UGC NET June 2025 exam will be conducted from 25th to 29th June 2025.

-> The UGC-NET exam takes place for 85 subjects, to determine the eligibility for 'Junior Research Fellowship’ and ‘Assistant Professor’ posts, as well as for PhD. admissions.

-> The exam is conducted bi-annually - in June and December cycles.

-> The exam comprises two papers - Paper I and Paper II. Paper I consists of 50 questions and Paper II consists of 100 questions. 

-> The candidates who are preparing for the exam can check the UGC NET Previous Year Papers and UGC NET Test Series to boost their preparations.

More OOPs concept Questions

Get Free Access Now
Hot Links: teen patti noble teen patti real cash withdrawal teen patti master 2023 teen patti master real cash teen patti real cash 2024