Give me the description of public static void main(Strings args)
public-It indicates that the main() method can be called by any object.
static-It indicates that the main() method is a class method.
void- It indicates that the main() method has no return value.
(String args)-It is used for receiving any arbitirary number of arguments and save it in the array.
public static void main(Strings args)
As u knw that to write a main method we need a class...unlike C++ ...so once class is loaded main method also needs to be loaded so that compiler can run this method...and this is done if main is static coz for static we dont want an object of the class to be created ...it is loaded as soon as it compiles....so static is required
void is required coz it is starting point of application...so nothing will return from starting point
main is required coz compiler understands this method as starting method...
String args is an array of string which u can pass if u want to perforn some operation using these arguments...for eg if arg is "hi" print "hi"..if arg is "hello" print "hello"
public is required coz to access this main method it has to be visible by compiler and this is possible if it is public since private is visible only in that class...
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.