How to run a .class file that is part of a package from cmd?

后端 未结 12 1261
梦如初夏
梦如初夏 2020-12-01 07:11

I keep getting errors when I make my .class part of a package and try to run it from cmd.

Here\'s the code that works after using jav

12条回答
  •  南笙
    南笙 (楼主)
    2020-12-01 08:13

    Create a folder named com under Java folder and put the HelloWorld.java into com folder. Then run again javac and java.

提交回复
热议问题