class Student
{
private String name;
private int age;
public String getName()
{
return name;
}
public void setName(String stuName)
{
name = stuName;
}
public int getAge()
{
return age;
}
public void setAge(int stuAge)
{
age = stuAge;
}
}
public class kejian
{
public static void main(String[] args)
{
Student stu = new Student();
stu.setAge(-30);
stu.setName("李芳");
}
}
|
|