-->
当前位置:首页 > 题库

单选题:About the scope of member variables, which statement is correct?

Luz5年前 (2021-05-10)题库1020
About the scope of member variables, which statement is correct? @[C](2)

A. Only public variables can be used in all methods.
B. A private variable can be used directly in the public static void main(String[] args).
C. All member variables are accessible in all non-static member methods.
D. static variables can be used in static methods only.





A.Only public variables can be used in all methods.
B.A private variable can be used directly in the public static void main(String[] args).
C.All member variables are accessible in all non-static member methods.
D.static variables can be used in static methods only.


答案:C