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 / sivadasan

1. public - Access Specifier, properties and methods can
access anywhere, any package.

2. main() - The Java environment starts the execution of a
program from main() method.

3. void - The main() method is not return anything. So the
return type of the main() method must be void.

4. static - The jave environment able to call the main()
method without creating an instance of the class. So its
declared as static

5...(String args[]) -- In java, whatever we give, it will
takes as String. So we are giving the command line argumet
as String.


i hope it will help u..

Shivadasan
Coromandel Infotech

Is This Answer Correct ?    16 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How do you trim a space in java?

1024


Is it possible to compare various strings with the help of == operator? What are the risks involved?

1126


Which collections are thread safe in java?

958


Can we convert stringbuilder to string in java?

1029


What is parsing in grammar?

1087


What is a default method?

1111


What are alternatives to java serialization?

1185


Why hashmap is used in java?

1138


Given a singly linked list, determine whether it contains a loop or not without using temporary space?

1030


Why heap memory is called heap?

1093


Can an interface have a class?

1042


What is substring 1 in java?

1233


what is singleton in java?

1104


What is an interface in java?

1088


What does system.gc() and runtime.gc() methods do?

1093