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
What is the largest number a double can hold?
How big is a pointer?
What is the locale class in java programming?
What is tree node in java?
What is the flag in java?
What are the 5 types of research methods?
What does g mean in regex?
What is private static class in java?
What does java edition mean?
What is the use of beaninfo?
What are the procedures?
Which language is java?
Does string is thread-safe in java?
How do you do exponents in java?
What is map and hashmap in java?