为什么可以编译却运行不了?

public class HelloWorld{

public static void mian(String[] args){

int one = 10;

int two = 20;

int three = 0;

three = one + two;

System.out.println("three = two + one" + three );

three += one ;

System.out.println("three += one" + three );

three -= one ;

System.out.println("three -= one" + three );

three *= one ;

System.out.println("three *= one" + three );

three /= one ;

System.out.println("three /= one" + three );

three %= one ;

System.out.println("three %= one" + three );

}

}

D:\liujiahao>javac HelloWorld.java


D:\liujiahao>java HelloWorld

错误: 在类 HelloWorld 中找不到主方法, 请将主方法定义为:

   public static void main(String[] args)


D:\liujiahao>java HelloWorld

错误: 在类 HelloWorld 中找不到主方法, 请将主方法定义为:

   public static void main(String[] args)


此生不变丶
浏览 1492回答 1
1回答

chavin

你的main方法  名字写错了
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

Java