How to access static nested classes?

Pham Quỳnh

New member
How to access static nested classes?
A. OuterClass.StaticNestedClass
B. OuterClass->StaticNestedClass
C. OuterClass(StaticNestedClass)
D. OuterClass[StaticNestedClass]
 
Answer: a
Explanation: Like any other member of the class, the static nested class uses the dot operator to be accessed. The reason behind is, the static classes can’t work with instances, hence we use enclosing class name to access static nested class.
 

Tìm kiếm

Back
Top