File tree Expand file tree Collapse file tree 2 files changed +118
-0
lines changed Expand file tree Collapse file tree 2 files changed +118
-0
lines changed Original file line number Diff line number Diff line change
1
+ abstract class BeingSundar {
2
+ abstract void goods ();
3
+ abstract void bads ();
4
+ public void complications (){
5
+ System .out .println ("it's complicated..." );
6
+ }
7
+ }
8
+ class Mayank extends BeingSundar {
9
+ @ Override
10
+ public void goods (){
11
+ System .out .println ("1. Sundar ladkiyo ki kami nhi..." );
12
+ System .out .println ("2. Overconfidence ki me bahot sundar hu..." );
13
+ System .out .println ("3. Modeling kr skte hai..." );
14
+ }
15
+ @ Override
16
+ public void bads (){
17
+ System .out .println ("1. Dosro ko judge ya comment krna ..." );
18
+ System .out .println ("2. Shoes ka color match krna chahiye" );
19
+ System .out .println ("3. ladkiyo ki kami nhi..." );
20
+ }
21
+ public void intro (){
22
+ System .out .println ("i am mayank..." );
23
+ }
24
+ }
25
+ class Priya extends BeingSundar {
26
+ public void goods (){
27
+ System .out .println ("1. kuchh bhi pahan lo achhe lagte ho..." );
28
+ }
29
+ @ Override
30
+ public void bads (){
31
+ System .out .println ("1. ladko ki lammbi line..." );
32
+ }
33
+ }
34
+
35
+ class Oops4 {
36
+ public static void main (String [] args ){
37
+ BeingSundar sundar = new Mayank ();
38
+ sundar .goods ();
39
+ sundar .bads ();
40
+ sundar .complications ();
41
+
42
+ sundar = new Priya ();
43
+ sundar .goods ();
44
+ sundar .bads ();
45
+ }
46
+ }
Original file line number Diff line number Diff line change
1
+ interface BeingSundar {
2
+ void goods ();
3
+ void bads ();
4
+ /*public void complications(){
5
+ System.out.println("it's complicated...");
6
+ }*/ //interface cannot have a body method
7
+ default void complications (){
8
+ System .out .println ("it's complicated..." );
9
+ }
10
+ }
11
+ class Mayank implements BeingSundar {
12
+ @ Override
13
+ public void goods (){
14
+ System .out .println ("1. Sundar ladkiyo ki kami nhi..." );
15
+ System .out .println ("2. Overconfidence ki me bahot sundar hu..." );
16
+ System .out .println ("3. Modeling kr skte hai..." );
17
+ }
18
+ @ Override
19
+ public void bads (){
20
+ System .out .println ("1. Dosro ko judge ya comment krna ..." );
21
+ System .out .println ("2. Shoes ka color match krna chahiye" );
22
+ System .out .println ("3. ladkiyo ki kami nhi..." );
23
+ }
24
+ public void intro (){
25
+ System .out .println ("i am mayank..." );
26
+ }
27
+ }
28
+ class Priya implements BeingSundar {
29
+ public void goods (){
30
+ System .out .println ("1. kuchh bhi pahan lo achhe lagte ho..." );
31
+ }
32
+ @ Override
33
+ public void bads (){
34
+ System .out .println ("1. ladko ki lammbi line..." );
35
+ }
36
+ }
37
+
38
+ class Oops5 {
39
+ public static void main (String [] args ){
40
+ BeingSundar sundar = new Mayank ();
41
+ sundar .goods ();
42
+ sundar .bads ();
43
+ sundar .complications ();
44
+
45
+ sundar = new Priya ();
46
+ sundar .goods ();
47
+ sundar .bads ();
48
+
49
+ sundar = new BeingSundar (){
50
+ public void goods (){
51
+ System .out .println ("1. Bachhe bhi sundar hoge" );
52
+ }
53
+ @ Override
54
+ public void bads (){
55
+ System .out .println ("1. koi gaurantee nhi hai bachha gora hoga..." );
56
+ }
57
+ };
58
+ sundar .goods ();
59
+ sundar .bads ();
60
+
61
+ new BeingSundar (){
62
+ public void goods (){
63
+ System .out .println ("1. Ease to interact and get attention easily" );
64
+ System .out .println ("2. Easy friendship" );
65
+ }
66
+ @ Override
67
+ public void bads (){
68
+ System .out .println ("1. Jalne wale log..." );
69
+ }
70
+ }.goods ();
71
+ }
72
+ }
You can’t perform that action at this time.
0 commit comments