-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathOops5.java
72 lines (68 loc) · 1.72 KB
/
Oops5.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
72
interface BeingSundar{
void goods();
void bads();
/*public void complications(){
System.out.println("it's complicated...");
}*///interface cannot have a body method
default void complications(){
System.out.println("it's complicated...");
}
}
class Mayank implements BeingSundar{
@Override
public void goods(){
System.out.println("1. Sundar ladkiyo ki kami nhi...");
System.out.println("2. Overconfidence ki me bahot sundar hu...");
System.out.println("3. Modeling kr skte hai...");
}
@Override
public void bads(){
System.out.println("1. Dosro ko judge ya comment krna ...");
System.out.println("2. Shoes ka color match krna chahiye");
System.out.println("3. ladkiyo ki kami nhi...");
}
public void intro(){
System.out.println("i am mayank...");
}
}
class Priya implements BeingSundar{
public void goods(){
System.out.println("1. kuchh bhi pahan lo achhe lagte ho...");
}
@Override
public void bads(){
System.out.println("1. ladko ki lammbi line...");
}
}
class Oops5{
public static void main(String[] args){
BeingSundar sundar = new Mayank();
sundar.goods();
sundar.bads();
sundar.complications();
sundar = new Priya();
sundar.goods();
sundar.bads();
sundar = new BeingSundar(){
public void goods(){
System.out.println("1. Bachhe bhi sundar hoge");
}
@Override
public void bads(){
System.out.println("1. koi gaurantee nhi hai bachha gora hoga...");
}
};
sundar.goods();
sundar.bads();
new BeingSundar(){
public void goods(){
System.out.println("1. Ease to interact and get attention easily");
System.out.println("2. Easy friendship");
}
@Override
public void bads(){
System.out.println("1. Jalne wale log...");
}
}.goods();
}
}