Question 88Asked in DSSSB PGT Computer Science (Technical), 11 Jul 2021

Which statement is correct about static member function in C++?

Which statement is correct about static member function in C++? I. It can access to only other static members declared in the same class. II. It cannot be called using the class name (instead of its objects)
  1. AOnly I
  2. BOnly II
  3. CBoth I and II
  4. DNeither I nor II
Show answerHide answer

Correct answer: (A) Only I

Explanation

A static member function can access only static members of its class, and it can be called with the class name (Class::f()). So only I is correct.

From DSSSB PGT Computer Science PYQ (Technical), 11 Jul 2021

This is question 88 of DSSSB PGT Computer Science PYQ (Technical), 11 Jul 2021. See all questions of this paper with answers, or attempt the paper as a timed online test to get your score and all-India rank.