Multiple choice technology programming languages

C++

  1. class aClass{public:int x;};

  2. /* A comment */

  3. char x=12;

  4. None of the Above

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

The syntax class aClass { public: int x; }; is valid C++ for declaring a class with a public member. Option B is just a comment. Option C declares a variable, not a class definition. Therefore A is correct.