class Student
{
Student(String name,int age,int score)
{
}
private String name;
public void setName(String name)
{
this.name=name;
}
public String getName()
{
return name;
}
private int age;
public void setAge(int age)
{
this.age=age;
}
public int getAge()
{
return age;
}
private int score;
public void setScore(int score)
{
this.score=score;
}
public int getScore(int score)
{
return score;
}
void show()
{
System.out.println(name+"的年龄为"+age+"岁,成绩为"+score);
}
}
class StudentDemo
{
public static void main(String[] args)
{
Student s1=new Student("zhagnsan",13,89);
s1.show();
}
}
请问,为什么显示的结果都没有赋值呢? |