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 / bhavya

Since main method is made private JVM does not find the main class, so it says there is no main method.

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Where are the local variables stored?

1122


What is string syntax?

1104


Can we create constructor in abstract class ?

1113


What is a lambda expression ? What's its use ?

1157


What are parsing rules?

1046


Why do we need data serialization?

1040


What is the difference between I ++ and ++ I in java?

1025


Can You Have Virtual Functions In Java?

1203


What are the types of web technologies?

1081


Why super is first line in java?

1099


Differentiate between the constructors and methods in java?

994


What is reflexive association?

1874


What is final keyword in java? Give an example.

1061


Why put method is used?

1053


Why is the main method declared static?

1181