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
Can we declare a static variable inside a method?
Is there any limitation of using inheritance?
What is complexity in java?
What is the final class modifier?
Why is inheritance used in java?
How do you check if a character in a string is a digit or letter?
What is the difference between preemptive scheduling and time slicing in java programming?
Mention a package that is used for linked list class in java.
What are the advantages of encapsulation in java?
What are extraneous variables examples?
How to find the index of the largest number in an arraylist java?
Can we split string with in java?
What are the differences between Java 1.0 and Java 2.0?
How many types of memory areas are allocated by jvm?
What does jre stand for?