UCB CS61b——Class 1

为君一笑 提交于 2019-11-30 10:43:55

编译

在terminal中,运行Java程序,首先dir(相当于Linux中的ls)和cd到对应文件夹
javac xxx.java编译Java程序

C:\Users\phoeb\IdeaProjects\beginner\src\hello_pkg>javac hello_world.java

用window中的type命令查看编译出的class文件(不同于Linux中的cat)

C:\Users\phoeb\IdeaProjects\beginner\src\hello_pkg>type hello_world.class
漱壕   8 
         
     <init> ()V Code LineNumberTable main ([Ljava/lang/String;)V
SourceFile hello_world.java     Hello world Phoebe

然后运行

C:\Users\phoeb\IdeaProjects\beginner\src\hello_pkg>java hello_world.java
Hello world Phoebe
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!