-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBook.java.bak
More file actions
46 lines (38 loc) · 798 Bytes
/
Book.java.bak
File metadata and controls
46 lines (38 loc) · 798 Bytes
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
class Book{
private String title;
private String author;
private String publish;
private int price;
public Book(String t, String a, String pu, int pr){
this.title=t;
this.author=a;
this.publish=pu;
this.price=pr;
}
public Book(String t, String a, String pu){
this.title=t;
this.author=a;
this.publish=pu;
}
public Book(String a, String pu, int pr){
this.author=a;
this.publish=pu;
this.price=pr;
}
public Book(){
}
public void setTitle(String title){
this.title=title;
}
public String getTitle(){
return title;
}
public static void main(String ar[]){
Book b1=new Book("a","aa","aaa",100);
Book b2=new Book("b","bb","bbb");
Book b3=new Book("cc","ccc",200);
Book b4=new Book();
b4.setTitle("d");
System.out.println(b4.getTitle());
}
}