1 Exceptions and Method Overriding Recall that when a subclass method overrides a superclass method.
• It must have the same signature
• Its return value must be the same or a subclass of that of the superclass method
• Its access mode must be the same or wider than that of the superclass method
In other words, the overriding subclass method
• Can remove an exception class declared in the superclass method header
• Can replace an exception class by a subclass
• But cannot add extra checked exception classes that are not subclasses of the
exceptions declared in the superclass method
Sun | Mon | Tue | Wed | Thu | Fri | Sat |
---|---|---|---|---|---|---|
27 | 28 | 29 | 30 | 1 | 2 | 3 |
4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 | 19 | 20 | 21 | 22 | 23 | 24 |
25 | 26 | 27 | 28 | 29 | 30 | 31 |