定义一个Student类,包含int sno,String name,int age三个成员变量,包含三个成员变量的setter和getter方法。(只提交类的定义)
裁判测试程序样例:
import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc=new Scanner(System.in);
Student student=new Student();
student.setSno(sc.nextInt());
student.setName(sc.next());
student.setAge(sc.nextInt());
System.out.print(student.getSno());
System.out.print(","+student.getName());
System.out.print(","+student.getAge());
System.out.println();
}
}
/*答案写在这里*/
输入样例:
测试程序输入学号、姓名和年龄
123456
zhangsan
20
输出样例:
测试程序输出
123456,zhangsan,20