Skip to content

Commit ad3f4ee

Browse files
author
Ram swaroop
committed
minor changes
1 parent 82afc23 commit ad3f4ee

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

_posts/2015-05-29-overriding.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ class Horse extends Animal {
6666
return new Horse();
6767
}
6868

69-
public void eat() throws Exception { // Not a method override as the overridden method doesn't
69+
public void eat() throws Exception { // Invalid method override as the overridden method doesn't
7070
// throw any checked exceptions while overriding method does
7171
// (gives a compiler error)
7272
System.out.println("Horse Eat");
@@ -77,7 +77,7 @@ class Horse extends Animal {
7777
System.out.println("Horse Sleep");
7878
}
7979

80-
public void sleep() throws Exception { // Not a method override as Exception is neither
80+
public void sleep() throws Exception { // Invalid method override as Exception is neither
8181
// same as nor a subclass of IOException
8282
// (gives a compiler error)
8383
System.out.println("Horse Sleep");

0 commit comments

Comments
 (0)