“公共静态无效主体"在java中 [英] "public static void main" in java

查看:72
本文介绍了“公共静态无效主体"在java中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

先生/女士,

我想要"public static void main" plz的详细信息.........

sir/madam,

i want the details of "public static void main" plz .........

推荐答案

此处:了解公共静态void主函数 [
Here: About 33,800,000 results (0.22 seconds) [^]

First link: Understanding public static void main function[^]


The main method is the first method, which the Java Virtual Machine executes. When you execute a class with the Java interpreter, the runtime system starts by calling the class''s main() method. The main() method then calls all the other methods required to run your application. It can be said that the main method is the entry point in the Java program and java program can''t run without this method.

The signature of main() method looks like this:
public static void main(String args[])

The method signature for the main() method contains three modifiers:

public indicates that the main() method can be called by any object.
static indicates that the main() method is a class method.
void indicates that the main() method has no return value.


简短答案:
main是您的Java应用程序的入口点.
{public, static, void}是其详细信息.

作为开发人员,您应该弄清楚为什么为什么应用程序入口点必须如此,
Short answer:
main is the entry point of your Java application.
{public, static, void} are its details.

As a developer, you should figure out why the application entry point has to be so, however:
  • public - We should expose the application entry point, after all.
  • static - This means we may call it without first creating any object. It makes sense, since it starts the program.
  • void - That is: we return no value to the virtual machine (the reason for is explained here[^]).


这篇关于“公共静态无效主体"在java中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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