10/15作業分
This commit is contained in:
27
Book.java
27
Book.java
@@ -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;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user