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


class test
{
private static void main(String []adsf)
{

}
}

explain me that the above code is error or exception

Answers were Sorted based on User's Feedback



class test { private static void main(String []adsf) { } } explain me that the above ..

Answer / bhargava

Code will throw exception. Because usually every stand
alone program execution should start with main method. It
should be public other wise this method doesnt exposed to
out side to run.

Is This Answer Correct ?    12 Yes 0 No

class test { private static void main(String []adsf) { } } explain me that the above ..

Answer / sri

It will not generate any compile time error, but while
running the program it will generate the output as "main
method is not public".....

Is This Answer Correct ?    7 Yes 0 No

class test { private static void main(String []adsf) { } } explain me that the above ..

Answer / xavier

This will throw a runtime error stating main method not public
This is because main method is the starting point of program
execution and it should be accessible by JVM

Is This Answer Correct ?    2 Yes 0 No

Post New Answer

More Core Java Interview Questions

Which collection is best for sorting in java?

0 Answers  


What are the two categories of data types in the java programming language?

0 Answers  


How are this() and super() used with constructors?

9 Answers  


suppose string s1="rajnish"; string s2="bhaskar"; then what will be happend ?

9 Answers   Fidelity,


How we get some middle records in one table?

2 Answers   3i Infotech,


What are the differences between Java 1.0 and Java 2.0?

0 Answers  


What is a for loop in java?

0 Answers  


What are the two types of java programming?

0 Answers  


What happens if a try-catch-finally statement does not have a catch clause to handle an exception that is thrown within the body of the try statement?

0 Answers  


What is meant by vector class, dictionary class, hash table class, and property class?

0 Answers  


what is inner class?

6 Answers   HCL,


What is listnode in java?

0 Answers  


Categories