forked from vishallovecode/JavaWithDsa
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAbtraction.java
50 lines (39 loc) · 1.03 KB
/
Abtraction.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
abstract class Robot {
public void readBook(){
System.out.println("Robot ios reading a book..");
}
public void writeNotes() {
System.out.println("Robot ios writing a notes..");
}
abstract void makeDinner() ;
abstract void clearRoom();
abstract void giveMeStudyalert();
}
class newRobot extends Robot {
public void makeDinner () {
System.out.println("Robot is making a dinner for me");
}
public void clearRoom () {
System.out.println("Robot is cleaming..");
}
public void giveMeStudyalert () {
System.out.println("Robot give me alert");
}
}
public class Abtraction {
public static void main(String[] args) {
// Robot rb = new Robot() ; // intatinitae will not happen
newRobot nr = new newRobot();
nr.makeDinner();
nr.clearRoom();
nr.giveMeStudyalert();
nr.readBook();
nr.writeNotes();
}
}
// I am learning the robotics engineer
// readBook
// writeNotes
// makeDinner
// clearRoom
// giveMeStudyalert