Specifications
Sun Services
Java™ Programming Language
Module 8, slide 16 of 25
Copyright 2005 Sun Microsystems, Inc. All Rights Reserved. Sun Services, Revision F
Method Overriding and Exceptions
1 public class TestA {
2 public void methodA() throws IOException {
3 // do some file manipulation
4 }
5}
1 public class TestB1 extends TestA {
2 public void methodA() throws EOFException {
3 // do some file manipulation
4}
5}
1 public class TestB2 extends TestA {
2 public void methodA() throws Exception { // WRONG
3 // do some file manipulation
4}
5}










