init
This commit is contained in:
55
Question24-VariousFileFormats/src/Library.java
Normal file
55
Question24-VariousFileFormats/src/Library.java
Normal file
@@ -0,0 +1,55 @@
|
||||
|
||||
public class Library {
|
||||
private String name;
|
||||
private String postNumber;
|
||||
private String address;
|
||||
private String tel;
|
||||
|
||||
public Library(String name, String postNumber, String address, String tel) {
|
||||
this.name = name;
|
||||
this.postNumber = postNumber;
|
||||
this.address = address;
|
||||
this.tel = tel;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getPostNumber() {
|
||||
return postNumber;
|
||||
}
|
||||
|
||||
public void setPostNumber(String postNumber) {
|
||||
this.postNumber = postNumber;
|
||||
}
|
||||
|
||||
public String getAddress() {
|
||||
return address;
|
||||
}
|
||||
|
||||
public void setAddress(String address) {
|
||||
this.address = address;
|
||||
}
|
||||
|
||||
public String getTel() {
|
||||
return tel;
|
||||
}
|
||||
|
||||
public void setTel(String tel) {
|
||||
this.tel = tel;
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("名前:" + this.name + "\n");
|
||||
sb.append("郵便番号:" + this.postNumber + "\n");
|
||||
sb.append("住所:" + this.address + "\n");
|
||||
sb.append("電話番号:" + this.tel + "\n");
|
||||
return sb.toString();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user