Hi
Thanks a lot but still my doudt is not cleared.
My Question is Why iam gettin the Exception after the declaration !
code is ->
import java.io.*;
class Excep {
int i=0;
/*public int myMethod1()
{
try{
i= myMethod2();
System.out.println(i);
}
catch(IOException e)
{
e.printStackTrace();
}
return i;
}*/
public int myMethod1() throws EOFException
{
return myMethod2();
}
public int myMethod2() throws EOFException
{
int a=10;int b=20;
int c=a+b;
return c;
}
public static void main(
String args[])
{
Excep e=new Excep();
e.myMethod1();
}
}