Why does a looser specification in an overriding method compile after the exception specification fo
- by Everyone
The code below has an overridden method with a looser exception specification as compared to the method being overridden.
//AnotherMain.java
public class AnotherMain {
public void dummyMethod( String args[] ) throws IOException{
throw new IOException();
}
}
//SubAnotherMain.java
public class SubAnotherMain extends AnotherMain{
…