I declared main() method as private. But it still running
and displaying the output. Please Answer it .
Code Snippet as Below:
import java.io.*;
class over
{
private static void main(String[] args)
{
int high = Integer.MAX_VALUE;
int overflow = high + 1;
int low = Integer.MIN_VALUE;
int underflow = low - 1;
System.out.println(high + "\n" +overflow +"\n"+
low +"\n"+underflow);
//System.out.println(overflow);
//System.out.println(low);
//System.out.println(underflow);
}
}
Answer Posted / ravi ranjan
OUTPUT = NO SUCH A METHOD EXCEPTION
REGION= MAIN METHOD MUST BE PUBLIC BECAUSE IT CALLED BY THE
DEMON THREAD
Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
What is join () in java?
What is locale?
What are different access specifiers in java? Explain
What is identifier with example?
How do you control extraneous variables?
What is the same as procedures?
What are functions in java?
When is the garbage collection used in Java?
How to create an immutable class?
What is class and object in java?
Can we declare an interface as final?
What are some characteristics of interference class?
What is the default value of byte datatype in java?
What do you mean by garbage collection used in java?
how to convert Java project into Maven ?