-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBook.java
More file actions
64 lines (61 loc) · 1.06 KB
/
Book.java
File metadata and controls
64 lines (61 loc) · 1.06 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
64
package Project;
public class Book {
/*class Books
{*/
private String name;
private Author author;
private double price;
private int qty;
Book(String name, Author author, double price)
{
this.name=name;
this.author=author;
this.price=price;
}
Book(String name, Author author, double price, int qty)
{
this.name=name;
this.author=author;
this.price=price;
this.qty=qty;
}
Book(Book b)
{
this.name=b.name;
this.author=b.author;
this.price=b.price;
this.qty=1;
}
public String getName()
{
return name;
}
public Author getAuthor()
{
return author;
}
public double getPrice()
{
return price;
}
public void setPrice(double price)
{
this.price=price;
}
public int getQty()
{
return qty;
}
public void setQty(int qty)
{
this.qty=qty;
}
public String display()
{
String s="[name="+name+",Author="+author.display()+"price="+price+",quantity="+qty+"]";
return s;
}
}
/* Ankit Raj Biswal
1941012238
CSE D*/