2段階目完了しました。

This commit is contained in:
s-ohasi
2026-09-15 14:58:52 +09:00
parent e6753a16f4
commit 542af2a5d4
2 changed files with 8 additions and 4 deletions

View File

@@ -3,12 +3,12 @@ public class BasicCheck2 {
public static void main(String[] args) { public static void main(String[] args) {
// TODO 自動生成されたメソッド・スタブ // TODO 自動生成されたメソッド・スタブ
Student st = new Student(); Student student = new Student();
st.studentId=1; student.studentId=1;
st.name="鈴木一郎"; student.name="鈴木一郎";
System.out.println("学籍番号:" + st.studentId + " 名前:" + st.name); student.printProfile();
} }
} }

View File

@@ -3,4 +3,8 @@ public class Student {
int studentId; int studentId;
String name; String name;
public void printProfile() {
System.out.println("学籍番号:" + this.studentId + " 名前:" + this.name);
}
} }