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
Difference between start() and run() method of thread class?
What about interrupt() method of thread class ?
What is e java?
What is JFC?
What is the difference between overriding & overloading?
What is palindrome in java?
What is meant by attribute?
Class c implements interface I containing method m1 and m2 declarations. Class c has provided implementation for method m2. Can I create an object of class c?
What is core java used for?
Can you extend singleton class?
What do you mean by synchronized non access modifier?
Why multiple inheritance is not supported by java?
what is heap memory?
Explain numeric promotion?
Explain all java features with real time examples