在Java中调用方法 [英] calling the method in java

查看:55
本文介绍了在Java中调用方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果程序包含以下代码:-

If the program contains the code:-

class X{

static void main()
{
----
}

public static void main(String[] args)
{
----
}
}





Which one of the method is called first for execution?

推荐答案

尝试一下!当我这样做的时候,第一个没有打电话,但是第二个没有打电话.那是因为其签名与JRE想要作为入口点的签名相匹配.
Try it! When I did, the first one never got called, but the second one did. That''s because its signature matches what the JRE wants as an entry point.


这篇关于在Java中调用方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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