In the following code when i chaged the return type then it did not give the compiler error just throw runtime exception.Is it not the syntex error to give the wrong return type of long instead of void.
class Jfilestr {
public static long main(String[] args) {
System.out.println("Hello");
return 10L;
//It will give the runtime exception.
/*Error: Main method must return a value of type void in class Jfilestr, please
define the main method as:
public static void main(String[] args)*/
}
}