大神,打扰一下,public static void main (String[] args)什么意思?
最新回答
山城夏秋
2025-06-17 05:38:33
(1)public:表示main方法可以由任何对象调用。
(2)static:表示这是一个类方法,区别于实例方法,与具体的对象无关。
(3)void:表示main方法没有返回值。
(4)String []args 是声明args可存储字符串数组;他是用来接受命令行传入的参数且只能为字符串 (1)public: It must be declared public.
(2)static: It must be declared static because it is being called on the class, not on a specific instance.