Which are syntactically valid statement at// point x?
class Person {
private int a;
public int change(int m){ return m; } }
public class Teacher extends Person {
public int b;
public static void main(String arg[]){
Person p = new Person();
Teacher t = new Teacher();
int i;
class Person {
private int a;
public int change(int m){ return m; } }
public class Teacher extends Person {
public int b;
public static void main(String arg[]){
Person p = new Person();
Teacher t = new Teacher();
int i;
// point ;
}
}
A. i = m;
B. i = b;
C. i = p.a;
D. i = p.change(30);
E. i = t.b.
b是类Teacher的public成员变量,但是在静态方法中不能使用类中的非静态成员。
b是类Teacher的public成员变量,但是在静态方法中不能使用类中的非静态成员。