...
OOPS
August 25, 2024
UML
August 25, 2024
OOPS
August 25, 2024
UML
August 25, 2024

OOPS

Question 125
Which constructor will be called by the following lines of code?
(i) Student S1;
(ii) Student S2=S1;
A
First copy constructor, then default constructor
B
First default constructor, then copy constructor
C
Default constructor for both lines of code
D
Copy constructor for both lines of code
Question 125 Explanation: 
→ Student S1:—-whenever we create object to the class , automatically default constructor will be called.
→ Student S2=S1:——The copy constructor is a constructor which creates an object by initializing it with an object of the same class, which has been created previously.
Correct Answer: B
Question 125 Explanation: 
→ Student S1:—-whenever we create object to the class , automatically default constructor will be called.
→ Student S2=S1:——The copy constructor is a constructor which creates an object by initializing it with an object of the same class, which has been created previously.

Leave a Reply

Your email address will not be published. Required fields are marked *