Solved

Which of the Following Class Definitions Is Correct in C

Question 30

Multiple Choice

Which of the following class definitions is correct in C++?


A) class studentType
{
Public:
Void setData(string, double, int) ;
Private:
String name;
};
B) class studentType
{
Public:
Void setData(string, double, int) ;
Void print() const;
Private:
String name;
Double gpa;
}
C) class studentType
{
Public void setData(string, double, int) ;
Private string name;
};
D) studentType class
{
Public: void setData(string, double, int) ;
Private: string name;
};

Correct Answer:

verifed

Verified

Unlock this answer now
Get Access to more Verified Answers free of charge

Related Questions