为什么在用eclipse运行java程序的时候,我程序没有错误,而在选择运行方式,却“无适用的”,怎么解决啊?
publicclassPerson{privateStringaddress;privateStringname;privateintage;publicStringge...
public class Person{
private String address;
private String name;
private int age;
public String getName(){
return name;
}
public int getAge(){
return age;
}
public void changeName(String new_name){
name=new_name;
}
public void incAge(){
age++;
}
public void setAge(int new_age){
age=new_age;
}
public String getAddress(){
return address;
}
public void setAddress(String x){
address=x;
}
public String toString(){
String s="Name:"+name+"\n";
s+="Age:"+age+"\n";
s+="Address:"+address+"\n";
return s;
}
}
就是这段程序。怎么运行咯?没有运行方式。 展开
private String address;
private String name;
private int age;
public String getName(){
return name;
}
public int getAge(){
return age;
}
public void changeName(String new_name){
name=new_name;
}
public void incAge(){
age++;
}
public void setAge(int new_age){
age=new_age;
}
public String getAddress(){
return address;
}
public void setAddress(String x){
address=x;
}
public String toString(){
String s="Name:"+name+"\n";
s+="Age:"+age+"\n";
s+="Address:"+address+"\n";
return s;
}
}
就是这段程序。怎么运行咯?没有运行方式。 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询