How can you explain very well, to a beginner, the meaning of String args[] and the use of static in the following excerpt?
class FirstApp {
public static void main(String[] args) {
...
}
}
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I would point a beginner to the Wiki article on the Main function, then supplement it with this.
Java only starts running a program with the specific
public static void main(String[] args)signature, and one can think of a signature like their own name – it’s how Java can tell the difference between someone else’smain()and the one truemain().String[] argsis a collection ofStrings, separated by a space, which can be typed into the program on the terminal. More times than not, the beginner isn’t going to use this variable, but it’s always there just in case.