package zuoye;
public class student {
int age;
String name;
int stuNO;
void outPut()
{
System.out.println("学生的姓名是:"+name);
System.out.println("年龄是:"+age);
System.out.println("学号是:"+stuNO);
}
}
package zuoye;
import java.util.Scanner;
public class TestClass {
public static void main(String[] args) {
student stu=new student();
Scanner sc=new Scanner(System.in);
System.out.println("请输入学生的姓名:");
stu.name=sc.nextLine();
System.out.println("请输入学号:");
stu.stuNO=sc.nextInt();
System.out.println("请输入年龄:");
stu.age=sc.nextInt();
stu.outPut();
}
}