OOPS
August 25, 2024
Software-Engineering
August 25, 2024
OOPS
August 25, 2024
Software-Engineering
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.
0 0 votes
Article Rating
Subscribe
Notify of
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x
error: Alert: Content selection is disabled!!