-
Notifications
You must be signed in to change notification settings - Fork 0
/
qb12.java
52 lines (40 loc) · 1.12 KB
/
qb12.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
//QB-12 (Data to get from Command line argument method ) // java Main Ishan ABC Raj PQR
class book {
private String author_name;
public book(String author_name) {
this.author_name = author_name;
}
void display() {
System.out.println("Book Author name is" + author_name);
}
}
class book_publication extends book {
private String title;
public book_publication(String author_name, String title) {
super(author_name);
this.title = title;
}
void display() {
System.out.println("Title name is:" + title);
super.display();
}
}
class paper_publication extends book {
private String title;
public paper_publication(String author_name, String title) {
super(author_name);
this.title = title;
}
void display() {
System.out.println("Title name is:" + title);
super.display();
}
}
class Main {
public static void main(String[] args) {
book b1 = new book_publication(args[0], args[1]);
book b2 = new paper_publication(args[2], args[3]);
b1.display();
b2.display();
}
}