i have a code
code
-----
import java.io.*;
class abc
{
public static void main()
{
getNextInteger() ;
}
static int getNextInteger()
{
String line;
DataInputStream in = new DataInputStream(System.in);
try {
line = in.readLine();
int i = Integer.valueOf(line).intValue();
return i;
}
catch (Exception e)
{
return -1;
}
} // getNextInteger ends here
}
i am learning java from a tutorial site..this code is compiling but
at the runtime i am getting " Exception in thread "main"
java.lang.NoSuchMethodError: main "
question 1: why " Exception in thread "main"
java.lang.NoSuchMethodError: main "....this error is coming...how
can i remove this?
question2
--------
i could not understand... " int i = Integer.valueOf(line).intValue
();" also. what is going on here????? two methods are here. what is
the job of two method??