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

In Java why we write public static void main(String args[])
why not main()?

Answer Posted / prabhakant prabhakar rasal

We write public because to access main() method outside the
class.
Why static because to invoke main() method before creating
any object, so it simple to compiler that to identify the
main() method.
void, it represents that it does not returns any value.
string args[]
There are two main reasons to write string args[]
1. TO identify the program
2. To get command_line arguments

Is This Answer Correct ?    27 Yes 13 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

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

1004


What's the base class in java from which all classes are derived?

1215


What is the difference between compare and compareto in java?

959


What are loops in java? What are three types of loops?

992


what state does a thread enter when it terminates its processing? : Java thread

998


Does set allows null in java?

914


Is a class an object?

953


How many types of array are there?

957


When do I need to use reflection feature in java?

1017


What is thread pool? How can we create thread pool in java?

1023


Is stringwriter thread safe?

944


Can java object be locked down for exclusive use by a given thread?

958


Write a java program to generate fibonacci series ?

1024


Which is better stringbuilder or stringbuffer?

883


What is a numeric digit?

1044