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 / kumaresan.r
Hai,
When you compile program it will run with out error,bt it
did not show the value of high,low,underflow.it just show that
"Main method not public.
Process completed.".
So we cant say that this is an output.
| Is This Answer Correct ? | 15 Yes | 0 No |
Post New Answer View All Answers
Where local and global variables are stored?
Does importing a package imports its sub-packages as well in java?
Which is the best approach for creating thread ?
What is the function of http?
How is the marker interface used in Java?
What is meant by object?
What is primitive data type in java?
Does substring start with 0?
What do you mean by buffering?
What is the difference between throw and throws keywords?
Why java is used everywhere?
What is try-with-resources in java?
What are the 4 types of research methods?
Name and explain the types of ways which are used to pass arguments in any function in java.
What is the longest unicode character?