Friday, June 1, 2012

Exceptions and return types in overriding.


import java.io.IOException;
import java.sql.*;
public class Test1 {
public Test4 myMetohd1() throws Exception
{
return null;
}

}

class Test2 extends Test1 {
public Test5  myMetohd1() throws SQLException, IOException
{
return null;
}
}

class Test3 extends Test1 {
public Test5 myMetohd1()
{
return null;
}
}

class Test4
{
}

class Test5 extends Test4
{
}

No comments:

Post a Comment