import java.util.Scanner;
class Student{
String name;
int num;
String sex;
}
public class day0 {
public static void main(String[] args) {
Student student = new Student();
day0 test = new day0();
test.getinformation(student);
System.out.println(student.sex+student.name+student.num);
}
public void getinformation(Student student){
Scanner sc = new Scanner(System.in);
System.out.println("请输入你的名字:");
student.name = sc.next();
System.out.println("请输入你的学号:");
student.num = sc.nextInt();
System.out.println("请输入你的性别:");
student.sex =sc.next();
}
}
|