Skip to content

Commit 1c181c5

Browse files
authored
Merge pull request #13 from imLLUS1ON/master
Update Exercise 4.5.java
2 parents 6c887d0 + 519bcbd commit 1c181c5

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

week 4/Exercise 4.5.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
11
// Interface ShapeX is created
22
interface 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
88
interface 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
1414
class 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+
}

0 commit comments

Comments
 (0)