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 are constructors in java?

1098


Why is java called the platform independent programming language?

1003


'A class is a template for an object' explain this statement.

1050


Is stringwriter thread safe?

993


Why chararray() is preferred over string to store the password?

1020


What is a loop java?

1049


What is the largest data type in java?

961


Given a singly linked list, find the middle of the list in a single traversal without using temporary variable.

1051


What is difference between array and arraylist in java?

985


Is array a class in java?

970


Is node a data type in java?

995


Explain about fail safe iterators in java?

1017


enlist some features of jdk.

950


What is percentage in java?

998


What is meant by flickering?

1077