-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBooks.java
More file actions
38 lines (38 loc) · 976 Bytes
/
Books.java
File metadata and controls
38 lines (38 loc) · 976 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
class Book
{
public String title;
public String author;
public int price;
public void getDescription()
{ }
}
class Ebook extends Book
{
void getDescription(String title,String author,float size)
{
System.err.println("--ebook--");
System.out.println("title::"+title);
System.out.println("author::"+author);
System.out.println("file-size::"+size+"mb");
}
}
class PrintedBook extends Book
{
void getDescription(String title,String author,float weight)
{
System.out.println("---Printed book---");
System.out.println("title::"+title);
System.out.println("author::"+author);
System.out.println("weight::"+weight+"kg");
}
}
class Books
{
public static void main(String[] args)
{
Ebook Eb=new Ebook();
Eb.getDescription("java", "JAMES GOSLING",17);
PrintedBook Pb=new PrintedBook();
Pb.getDescription("java", "JAMES GOSLING",1);
}
}