As the compiler said, EOFException is never thrown within the try block, so it's smart enough to tell you that your catch block for an EOFException is never going to be used and is simply code that will never be used. As for getting an error when you call main1(), since main1() declares that it throws two checked exceptions, the call to main1() must either be wrapped in a try/catch block or main() itself must declare that it also throws these exceptions.
class A {}
class B extends A {}
class C extends B {}
interface A {}
interface B {}
class C implements A, B{}
public void findOut(Integer y)
{
// Line 1
y = null;
}
public void findOut(Integer y){
y = null;
}