1.给出如下代码:class Test{ private int m; public static void fun()

1.给出如下代码:class Test{ private int m; public static void fun(){ //some code...​}
1.给出如下代码:
class Test{
private int m;
public static void fun(){
//some code...
}
}
如何使成员变量m被方法fun()直接访问?
A、将private int m改为protected int m
B、将private int m改为public int m
C、将private int m改为static int m
D、将private int m改为int m
fj1973_12 1年前 已收到1个回答 举报

wumay 幼苗

共回答了23个问题采纳率:87% 举报

选择C,static方法才能调用static变量

1年前

1
可能相似的问题
Copyright © 2024 YULUCN.COM - 雨露学习互助 - 16 q. 0.403 s. - webmaster@yulucn.com