主题:题目
//you should add the static keyword int the place of? in line _in the following code:
//
1 public class Test{
2 private int age;
3 public ? int square(int n)
4 {
return n*n;
5 }
6 public ? int getAge()
7 {
8 return age;
9 }
}
A.in line 3 B.in line 6 C.in both line 3 and line 6
我上机试过了。然后再讲解一下关于静态方法是怎么访问的 ,讲一下原理。谢谢
//
1 public class Test{
2 private int age;
3 public ? int square(int n)
4 {
return n*n;
5 }
6 public ? int getAge()
7 {
8 return age;
9 }
}
A.in line 3 B.in line 6 C.in both line 3 and line 6
我上机试过了。然后再讲解一下关于静态方法是怎么访问的 ,讲一下原理。谢谢