2段階目完了しました。
This commit is contained in:
@@ -3,12 +3,12 @@ public class BasicCheck2 {
|
||||
|
||||
public static void main(String[] args) {
|
||||
// TODO 自動生成されたメソッド・スタブ
|
||||
Student st = new Student();
|
||||
Student student = new Student();
|
||||
|
||||
st.studentId=1;
|
||||
st.name="鈴木一郎";
|
||||
student.studentId=1;
|
||||
student.name="鈴木一郎";
|
||||
|
||||
System.out.println("学籍番号:" + st.studentId + " 名前:" + st.name);
|
||||
student.printProfile();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -3,4 +3,8 @@ public class Student {
|
||||
int studentId;
|
||||
String name;
|
||||
|
||||
public void printProfile() {
|
||||
System.out.println("学籍番号:" + this.studentId + " 名前:" + this.name);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user