“String args []'和'public static void main(String [] args)'中的静态的解释 [英] Explanation of 'String args[]' and static in 'public static void main(String[] args)'

查看:120
本文介绍了“String args []'和'public static void main(String [] args)'中的静态的解释的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何解释初学者 String args [] 的含义以及 static 在以下摘录中?

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) {
        ...
    }
}


推荐答案

我想指一位初学者参加维基文章主要功能,然后补充它。

I would point a beginner to the Wiki article on the Main function, then supplement it with this.


  • Java只开始运行具有特定<$ c的程序$ c> public static void main(String [] args)签名,人们可以想到签名就像他们自己的名字一样 - 这就是Java如何区分别人的之间的区别main()和一个真正的 main()

  • 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's main() and the one true main().

String [] args 是一个 String 的集合,用空格分隔,可以输入终端上的程序。更多的时候,初学者不会使用这个变量,但总是存在以防万一。

String[] args is a collection of Strings, 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.

这篇关于“String args []'和'public static void main(String [] args)'中的静态的解释的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆