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?
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.