public class Test{
public int count(){
return 1%9;
}
public static void main(String[]args){
System.out.println(count());
}
}
运行结果为:
Exception in thread "main" java.lang.Error: Unresolved compilation problem:
Cannot make a static reference to the non-static method count() from the type Test1
at com.qianfeng.loginunittest.Test1.main(Test1.java:11)
A 编译错误
B 运行错误
C 正常运行,输出1
D 正常运行,输出0
解析: