0914 段階2
This commit is contained in:
12
em-oop/src/BasicCheck2.java
Normal file
12
em-oop/src/BasicCheck2.java
Normal file
@@ -0,0 +1,12 @@
|
||||
|
||||
public class BasicCheck2 {
|
||||
public static void main(String[] args) {
|
||||
Student student = new Student();
|
||||
|
||||
student.studentId = 1;
|
||||
student.name = "鈴木一郎";
|
||||
|
||||
student.printProfile();
|
||||
}
|
||||
|
||||
}
|
||||
11
em-oop/src/Student.java
Normal file
11
em-oop/src/Student.java
Normal file
@@ -0,0 +1,11 @@
|
||||
|
||||
public class Student {
|
||||
int studentId;
|
||||
String name;
|
||||
|
||||
public void printProfile() {
|
||||
System.out.println("学籍番号:" + this.studentId + " 名前:" + this.name);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user