-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcons_inheritance.java
71 lines (55 loc) · 1.71 KB
/
cons_inheritance.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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
/**
* Author : Manish Kavaiya
*/
package unit_2;
import java.util.*;
class Danger_Anger {
Scanner scan = new Scanner(System.in);
Danger_Anger() {
System.out.println("Constructor of Danger_Anger");
}
void angryLevel_1() {
System.out.println("Please Enter your Anger High or low or medium? :");
String high = scan.next();
System.out.println("Don't check any people anger side.");
}
protected void most_Anger_level1() {
System.out.println("End of Ander life");
}
}
class Medium_Anger extends Danger_Anger {
Medium_Anger() {
System.out.println("Constructor of Medium of Anger Life.");
}
void angryLeverl_2() {
System.out.println("Please enter your anger in rating type : ");
String number1 = scan.next();
System.out.println("That is level of Anger Life.");
}
protected void most_Anger_level2() {
System.out.println("End of Medium Anger Life");
}
}
class Normal_Anger extends Medium_Anger {
Normal_Anger() {
System.out.println("Constructor of Normal Life Anger.");
}
void angryLevel_3() {
System.out.println("Please enter your Anter rasio out of 100 : ");
int rasiotype = scan.nextInt();
System.out.println("That is a very low level of anger life.");
}
protected void most_Anger_level3() {
System.out.println("End of Normall Anger Life.");
}
}
public class cons_inheritance {
public static void main(String[] args) {
Normal_Anger very_Angry = new Normal_Anger();
very_Angry.angryLevel_1();
very_Angry.angryLeverl_2();
very_Angry.angryLevel_3();
very_Angry = null;
System.gc();
}
}