File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11// Interface ShapeX is created
22interface ShapeX {
3- public String baseX = "This is Shape1" ;
3+ public String base = "This is Shape1" ;
44 public void display1 ();
55}
66
77// Interface ShapeY is created which extends ShapeX
88interface ShapeY extends ShapeX {
9- public String baseY = "This is Shape2" ;
9+ public String base = "This is Shape2" ;
1010 public void display2 ();
1111}
1212
1313// Class ShapeG is created which implements ShapeY
1414class ShapeG implements ShapeY {
15- public String baseG = "This is Shape3" ;
15+ public String base = "This is Shape3" ;
1616 //Overriding method in ShapeX interface
1717 public void display1 () {
18- System .out .println ("Circle: " + baseX );
18+ System .out .println ("Circle: " + ShapeX . base );
1919 }
2020 // Override method in ShapeY interface
2121 public void display2 () {
22- System .out .print ("Circle: " + baseY );
22+ System .out .print ("Circle: " + ShapeY . base );
2323 }
2424}
2525
@@ -31,4 +31,4 @@ public static void main(String[] args) {
3131 circle .display1 ();
3232 circle .display2 ();
3333 }
34- }
34+ }
You can’t perform that action at this time.
0 commit comments