Given the code fragment: interface SampleClosable { public void close () throws java.io.IOException;

By | January 7, 2023

Given the code fragment:
interface SampleClosable {
public void close () throws java.io.IOException;
}
Which three implementations are valid?

Correct Answer: A,C,E
A: Throwing the same exception is fine.
C: Using a subclass of java.io.IOException (here java.io.FileNotFoundException) is fine
E: Not using a throw clause is fine.