JVM如何使用“主要方法”?启动Java程序? [英] How does the JVM use the "Main method" to start a Java program?

查看:146
本文介绍了JVM如何使用“主要方法”?启动Java程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

main 不是java中的关键字。 JVM如何知道执行 main 方法作为任何程序的起点?

main is not a keyword in java. How does the JVM know to execute the main method as the starting point of any program?

推荐答案

main 不需要是java中的关键字,以便JVM在执行开始时查找它。与其他方法或变量(也称为 main )没有冲突。这就是JVM规范的设计方式。它很可能是从c语言中借来的。

main doesn't need to be a keyword in java in order for the JVM to look for it at the start of execution. There is no conflict with other methods or variables also called main. This is simply how the JVM spec was designed. It was most likely borrowed from the c language.

Java规范参考:关键字调用main

Java Specification References: keywords, invoking main.

这篇关于JVM如何使用“主要方法”?启动Java程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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