Java OCA OCP Practice Question 1960

Question

Which statement is true?.

Select the one correct answer.

  • (a) Top-level classes can be declared static.
  • (b) Classes declared as members of top-level classes can be declared static.
  • (c) Local classes can be declared static.
  • (d) Anonymous classes can be declared static.
  • (e) No classes can be declared static.


(b)

Note

Classes can be declared as members of top-level classes.

Such a class is a static member class if it is declared static, otherwise, it is a non-static member class.

Top-level classes, local classes, and anonymous classes cannot be declared static.




PreviousNext

Related