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


Please Help Members By Posting Answers For Below Questions

What is join () in java?

526


What is locale?

599


What are different access specifiers in java? Explain

621


What is identifier with example?

564


How do you control extraneous variables?

501






What is the same as procedures?

528


What are functions in java?

496


When is the garbage collection used in Java?

654


How to create an immutable class?

564


What is class and object in java?

546


Can we declare an interface as final?

568


What are some characteristics of interference class?

508


What is the default value of byte datatype in java?

479


What do you mean by garbage collection used in java?

567


how to convert Java project into Maven ?

582