缺少返回语句 哪里的问题?
class student04 {
public static void main(String[] args) {
student s = new student();
s.setName("张三");
s.setAge(23);
System.out.println(s.getName() +s.getAge());
}
}
class student
{
String name;
int age;
public student(){}
public student(String name,int age){
this.name = name;
this.age = age;
}
public void setName(String name){
this.name =name;
}
public String getName(){
return name;
}
public String setAge(int age){
this.age = age;
}
public int getAge(){
return age;
}
}
|
|