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

could you run the java program without main method?

Answer Posted / amit singh

please put the System.exit(0) in static block thanks
class Moon
{
static
{
System.out.println("hello i am visible without main");
System.exit();
}
}
amit singh
amising2008@gmail.com

Is This Answer Correct ?    29 Yes 8 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

what is the difference between a threads start() and run() methods? : Java thread

961


how we can make a read-only class in java?

933


Define interface in java?

1023


What is fail first in java?

1078


Is 64bit faster than 32 bit?

1012


What is the synonym of string?

1035


What is the string function?

901


What does arrays sort do in java?

960


How do you convert an int to a string in java?

1053


What is compiler and what its output.

1075


Why strings in java are called as immutable?

946


Why string is immutable with example?

907


What is hash table in java?

940


What is java string pool?

947


What is integer size in java?

944