could you run the java program without main method?
Answer Posted / a.d. vijaykumaran
Yes. static is powerful word in java because of within
static block inside we can define statement and then
System.exit(0); use this to avoid runtime error main thread
exception error.
class Beatme //we can use any abstract class or interface
{
static // we can't do throws Exception
{
System.out.println("A.D.Vijaykumaran");
System.exit(0);
}
}
and one disadvantage above the program as doesn't
define "System defined Exception r throws Exception" .
Is This Answer Correct ? | 13 Yes | 2 No |
Post New Answer View All Answers
Should you use singleton pattern?
What is the size of arraylist in java?
What is method with example?
describe method overloading
Is main an identifier?
What is string pool in java?
What is an arraylist in java?
Is main a keyword in java?
Explain public static void main(string args[]).
What is protected in java?
which is advanced deep technology in java launched by the sun microsystem??? The answer is very logical If u need correct answer mail me at priya_gupta@gmail.com
State the difference between strings and arrays.
how we can make a read-only class in java?
Why is java so important?
What is the default value of local and global variables?