Type Here to Get Search Results !

Which of the following is true regarding static members in a class?

0

 Which of the following is true regarding static members in a class?

A) They can only be accessed by instances of the class.
B) They belong to the class rather than any particular instance.
C) They cannot be modified.
D) They cannot be inherited by subclasses.

Answer: B) They belong to the class rather than any particular instance.

Explanation: Static members (variables or methods) belong to the class itself rather than to any specific instance of the class. This means that they can be accessed without creating an instance of the class, and they are shared among all instances. Static members can be modified, and they can be inherited by subclasses.

Post a Comment

0 Comments