Multiple choice technology programming languages

By default fields in a C++ class

  1. Public

  2. Private

  3. Protected

  4. Unintialized

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

In C++, the default access specifier for class members (both data members and member functions) is 'private'. This means that unless explicitly specified as public or protected, class members are only accessible within the class itself. This is a fundamental principle of encapsulation in object-oriented programming with C++ classes. 'Unintialized' is not an access specifier - it's a state, not a visibility modifier.