Question
Easy

In context of C++, consider the following statements: I: Static member function of a class can access only static data members of the class. II: A static data member of class is shared by all the objects of the class. The true statement(s) is/are:

1
Only I
2
Only II
3
Both I and II
4
Neither I Nor II
Question Details
Time to Solve: 12
Exam: HTET
Level/Paper: Level 3
Chapter: Object-Oriented Programming (C++)
Topic: OOP Concepts
Correct Answer
Option C
Explanation

The correct option is (3): Both I and II The correct option is (3) because both statements accurately describe the behavior of static members in C++ classes. Statement II is the fundamental principle: a static data member is a class-level variable, meaning only a single copy of it exists, and this solitary copy is explicitly shared by every object instantiated from that class. This allows all objects to modify or…Read More