段階2
This commit is contained in:
@@ -2,20 +2,21 @@
|
||||
public class Student {
|
||||
int studentId;
|
||||
String name;
|
||||
|
||||
|
||||
public Student(int studentId, String name) {
|
||||
this.studentId = studentId;
|
||||
this.name = name;
|
||||
|
||||
}
|
||||
|
||||
|
||||
public void printProfile() {
|
||||
System.out.println("学籍番号:" + this.studentId + " 名前:" + this.name);
|
||||
}
|
||||
public static void main(String[] args) {
|
||||
Student s = new Student(1,"鈴木一郎");
|
||||
s.printProfile();
|
||||
//public static void main(String[] args) {
|
||||
//Student s = new Student(1,"鈴木一郎");
|
||||
//s.printProfile();
|
||||
|
||||
}
|
||||
//}
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user