-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBook.java
More file actions
42 lines (34 loc) · 965 Bytes
/
Book.java
File metadata and controls
42 lines (34 loc) · 965 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
import java.util.Scanner;
public class Book{
String name;
String author;
double price;
int qtyIntStock;
public Book(String the_cantreville_ghost, String valueof, double p, int q) {
name = the_cantreville_ghost;
author = valueof;
price =p;
qtyIntStock =q;
}
public String getName() {
return name;
}
public String getAuthor() {
return author;
}
public double getPrice() {
return price;
}
public int getQtyIntStock() {
return qtyIntStock;
}
public static void main(String[] args) {
Book obj = new Book("Gulliver Travells", "Jonathan Swift", 100.00, 1);
System.out.println("name: "+obj.name);
System.out.println("author: "+obj.author);
System.out.println("price: rs."+obj.price);
System.out.println("quantity: "+obj.qtyIntStock);
}
}
class Author {
}