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
How can constructor chaining be done using this keyword?
What are the differences between heap and stack memory in java?
Explain the usage of this with constructors?
Why collection is called framework in java?
Why is java architectural neutral?
How do you get the length of a string in java?
Why do we need variables?
Explain the JDB in depth & command line.
Can you call a method on a null object?
Why we cannot override static method?
Can we catch more than one exception in single catch block?
How does the garbage collector works in java?
What is math floor in java?
Where can i get Latest SUN Certification Dumps and what are the Sun Certification Codes that are available, Im new to JAVA, so please gimme info as i need to write J2EE - Core Java Certification
What is an example of character?