Which keyword is used to define a class in C++?

Options

  • A. object
  • B. class
  • C. define
  • D. More than one of the above
  • E. None of the above

Correct Answer (Detailed Explanation is Below)

B. class

Detailed Explanation

Correct Answer: Option B

Explanation:
The keyword class is used to define a class in C++. Example: class Student { };. The semicolon after the class definition is required.