-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBook.java
56 lines (56 loc) · 1.73 KB
/
Book.java
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
class Book
{
String code, title;
double price;
Book(String bookcode,String t,double pr)
{
code = bookcode;
title= t;
price= pr;
}
Book(double prl,String bookcode,String ti)
{
code = bookcode;
title= ti;
price= prl;
}
Book(String tt,double pri,String bookcode)
{
code = bookcode;
title= tt;
price= pri;
}
String getCode()
{
return code;
}
String getTitle()
{
return title;
}
double getPrice()
{
return price;
}
/*public static void main()
{
Book book1= new Book("sci200","A Place",680.00);
Book book2= new Book("adv109","Run!",400.00);
Book book3= new Book("Fict001","What!",290.00);
System.out.println("Book1" + "Code:" + book1.getCode() + " Title:" + book1.getTitle() + "Price"+ book1.getPrice());
System.out.println("Book2" + "Code:" + book2.getCode() + " Title:" + book2.getTitle() + "Price"+ book2.getPrice());
System.out.println("Book3" + "Code:" + book3.getCode() + " Title:" + book3.getTitle() + "Price"+ book3.getPrice());
}*/
}
class BookStore
{
public static void main()
{
Book book1= new Book("sci200","A Place",680.00);
Book book2= new Book("adv109","Run!",400.00);
Book book3= new Book("Fict001","What!",290.00);
System.out.println("Book1" + "Code:" + book1.getCode() + " Title:" + book1.getTitle() + "Price"+ book1.getPrice());
System.out.println("Book2" + "Code:" + book2.getCode() + " Title:" + book2.getTitle() + "Price"+ book2.getPrice());
System.out.println("Book3" + "Code:" + book3.getCode() + " Title:" + book3.getTitle() + "Price"+ book3.getPrice());
}
}