File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed
Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff 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");
You can’t perform that action at this time.
0 commit comments