10/15作業分

This commit is contained in:
2026-10-15 16:30:26 +09:00
parent 4b2cb5a18b
commit 82628fc7f5
9 changed files with 394 additions and 145 deletions

View File

@@ -4,14 +4,24 @@ public class BasicCheck1 {
public static void main(String[] args) {
// TODO 自動生成されたメソッド・スタブ
Book book = new Book();
//コンストラクタ
Book book1 = new Book();
book.title = "吾輩は猫である";
book.author = "夏目漱石";
book.price = 800;
//book1
System.out.println(book1.title);
System.out.println(book1.author);
System.out.println(book1.price);
//コンストラクタ
Book book2 = new Book(
"銀河鉄道の夜",
"宮沢賢治",
500);
//book2
System.out.println(book2.title);
System.out.println(book2.author);
System.out.println(book2.price);
System.out.println(book.title);
System.out.println(book.author);
System.out.println(book.price);
}
}