未分类 · 2025年11月21日

编译和运行以下代码的结果为: public class MyMain{ public static void main(String argv){ System.out.println(“Hello cruel world”); }} A.编译无错,但运行时指示没有定义构造方法 B.运行输出 ‘Hello cruel world’ C.编译错误 D.编译无错,但运行时指示找不到main方法

编译和运行以下代码的结果为: public class MyMain{ public static void main(String argv){ System.out.println(“Hello cruel world”); }} A.编译无错,但运行时指示没有定义构造方法 B.运行输出 ‘Hello cruel world’ C.编译错误 D.编译无错,但运行时指示找不到main方法

正确答案:D