Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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

Given a singly linked list, find the middle of the list in a single traversal without using temporary variable.

1056


What are the 8 data types in java?

1006


What are triggers in DB? Explain their types. How do they work?

1094


Is java code slower than native code?

1075


how does the run() method in runnable work? : Java thread

928


Can you override a final method?

1040


Is an empty arraylist null?

1103


What is the difference between normal report & matrix report?

1115


What is <> used for in java?

1123


How do constructors use this() and super()?

1125


Can we define private and protected modifiers for variables in interfaces?

1089


Explain what is Marker interface?

1094


What is the purpose of the finally clause of a try-catch-finally statement in java programming?

960


what is singleton class in java?

1061


Name few java 8 annotations ?

1033