lzyno1
171女生
2017-02-17 10:19

大神们,为啥调用时出错?为啥调用时出错?为啥调用时出错?

  • class

package com.TestPerson;

public class Person {
public static void main(String[] args) {
Person p=new Person();
p.setName();
p.info();

}

}
class Person {
private int age;
private String name;

public Person (){

}
public Person (String n){
    name=n;
}
public void setAge(int a){
    age=a;
}
public int getAge (){
    return age;
}
public void setName(String n){
    name=n;
}
大神们,为啥调用时出错?为啥调用时出错?为啥调用时出错?
  • 点赞
  • 回答
  • 收藏
  • 复制链接分享

3条回答