1.

Answer the question (i) and (ii) after going through the following class:class Exam{  int Rno,MaxMarks,MinMarks,Marks; public:Exam() //Module 1{  Rno=101; MaxMarks=100;MinMarks=40;Marks=75;}Exam(int Prno,int Pmarks) //Module 2{ Rno=Prno; MaxMarks=100;MinMarks=40;Marks=Pmarks;}~Exam() //Module 3{ cout<<"Exam Over"<<end1;}void Show() //Module 4{ cout<<Rno<<":"<<MaxMarks<<":"<<MinMarks<<end1;cout<<"[MarksGot]"<<Marks<<end1; };(i)  As per Object Oriented Programming, which concept is illustrated by Module 1 and Module 2 together? (ii)  What is Module 3 referred as? When do you think, Module 3 will be invoked/called?

Answer»

(i) Constructor overloading.

(ii) Destructor. It will be invoked when scope of an object gets over.



Discussion

No Comment Found

Related InterviewSolutions