Multiple choice

Which of the following is/are correct statements for classes and objects in C++ language?

  1. Static keyword is used to preserve the value of a variable.

  2. Member functions of a class can also be declared as constants.

  3. The local class has no access permission to global variables as well as static variables.

  4. Both 1 and 3

  5. Both 1 and 2

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

Both 1 and 2 are true. So, this is the correct option.