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

Have you ever used hashtable and dictionary?

1012


What are the different access modifiers available in java?

1036


What is a linkedhashmap java?

995


Can we serialize static variables in java?

1082


Why is it called a string?

1002


What is the maximum size of array in java?

978


Explain the importance of thread scheduler in java?

1003


What are the different types of constructor?

985


Why to use nested classes in java? (Or) what is the purpose of nested class in java?

1067


What is the difference between public, private, protected, and friend access?

1041


Which collection is ordered in java?

969


Why strings in java are called as immutable?

983


What is the this keyword?

1024


What is the difference between an inner class and a sub-class?

998


is it possible to instantiate the math class?

1025