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

@@ -1,7 +1,28 @@
package misson1014;
public class Book {
String title;
String author;
int price;
// タイトル
String title;
// 著者
String author;
// 価格
int price;
//コンストラクタ
public Book() {
this.title = "タイトル未設定";
this.author = "著者未設定";
this.price = 0;
}
//コンストラクタ
public Book(String title, String author, int price) {
//フィールド代入
this.title = title;
this.author = author;
this.price = price;
}
}