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

Name the components that are termed to be Heavy-weight component but available in Light-weight components?

2441


How are variables stored?

923


What is mean by exception?

965


How much is a java license?

868


Can you pass by reference in java?

935


What is a Transient Object?

1019


Can we have any code between try and finally blocks?

966


What are the restriction imposed on a static method or a static block of code?

995


Which data type is class in java?

951


What is the meaning of find and replace?

973


What is super keyword explain with example?

1203


What is the base class of all exception classes?

1018


Can a private method of a superclass be declared within a subclass?

958


What are desktop procedures?

998


How many types of operators are there?

929