-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBook.java
More file actions
63 lines (48 loc) · 1.02 KB
/
Book.java
File metadata and controls
63 lines (48 loc) · 1.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
package java3;
// Book b1 = new Book();
// 설계도 (상태, 행위, 초기화)
public class Book {
private int num; //책 번호
private String name; //책 이름
private int page; //책 페이지수
private String category; //책 카테고리
// Book b1 = new Book();
public Book() {
}
// Book b2 = new Book("알라딘", 300);
public Book(String name, int page) {
this.name = name;
this.page = page;
}
// Book b3 = new Book(1003, "사피엔스", 800, "과학");
public Book(int num, String name, int page, String category) {
this.num = num;
this.name = name;
this.page = page;
this.category = category;
}
public int getNum() {
return num;
}
public void setNum(int num) {
this.num = num;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public int getPage() {
return page;
}
public void setPage(int page) {
this.page = page;
}
public String getCategory() {
return category;
}
public void setCategory(String category) {
this.category = category;
}
}