package com.tb;
public class tb {
public class Student{
public String name;
public int age;
public int score;
public Student(){
}
public void setName(String name) {
this.name = name;
}
public void setAge(int age) {
this.age = age;
}
public void setScore(int score) {
this.score = score;
}
public String getName(){
return name;
}
有改动,但我只能做到这样了,不知道是不是这个意思
public int getAge(){
return age;
}
public int getScore(){
return score;
}
}
public static void main(String[] agrs){
tb tb = new tb();
tb.Student st1 = new tb().new Student();
st1.setName("悟空");
st1.setAge(15);
st1.setScore(789);
System.out.print(st1.getName() + " " + st1.getAge() + " " +st1.getScore() );
}
}