Question 35

This question is based on the following C++ code segment and class FUN : class FUN

This question is based on the following C++ code segment and class FUN : class FUN class FUN { int CODE ; public : FUN ( ); //Function1 FUN (int C); //Function2 FUN (FUN & F); //Function3 void DISP ( ); //Function4 ~FUN ( ); //Function5 }; void main ( ) { FUN F1 ; ______ // BLANK ______ ______} Which of the following is an example of default constructor?
  1. AFunction 1
  2. BFunction 2
  3. CFunction 3
  4. DFunction 5
Show answerHide answer

Correct answer: (A) Function 1

Explanation

A default constructor takes no arguments, so FUN() (Function 1) is the default constructor. FUN(int) is parameterized, FUN(FUN&) is the copy constructor, and ~FUN() is the destructor.

From DSSSB TGT Computer Science Practice Set 4

This is question 35 of DSSSB TGT Computer Science Practice Set 4. See all questions of this paper with answers, or attempt the paper as a timed online test to get your score and all-India rank.