posted 23 years ago
Question ID : 957711112180
interface I1
{
void m1() throws IOException
}
interface I2
{
void m1() throws SQLException
}
What methods have to be implemented by a class that says it implements I1 and I2 ?
OPTIONS :
1. Both, public void m1() throws SQLException, and public void m1() throws IOException
2. public void m1() throws IOException
3. The class cannot implement both the interfaces as they have conflicting methods
4. public void m1() throws SQLException, IOException
5.None of the above
Correct answer : 5.
The explanation mentions, "that the overiding method must have a throws clause
that is compatible with ALL the overridden declarations .So public void m1() satifies both the declarations"
But i fail to understand the meaning !