public class Test {
private String name;//属性
private int age;//属性
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public int getAge() {
return age;
}
public void setAge(int age) {
this.age = age;
}
}
这个就可以的
public class A{
int r;
public void run(){
System.out.println("run !");
}
}
public class Person {
private String name;
public void say() {
System.out.prinltn("hello");
}
}