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


Please Help Members By Posting Answers For Below Questions

Can we declare a static variable inside a method?

961


Is there any limitation of using inheritance?

1031


What is complexity in java?

979


What is the final class modifier?

977


Why is inheritance used in java?

1070


How do you check if a character in a string is a digit or letter?

1017


What is the difference between preemptive scheduling and time slicing in java programming?

979


Mention a package that is used for linked list class in java.

911


What are the advantages of encapsulation in java?

962


What are extraneous variables examples?

1024


How to find the index of the largest number in an arraylist java?

970


Can we split string with in java?

959


What are the differences between Java 1.0 and Java 2.0?

2212


How many types of memory areas are allocated by jvm?

985


What does jre stand for?

1011