这是本文档旧的修订版!
下载:绪论
编程语言发展史【高清图】
JAVA_HOME: C:\Program Files\Java\jdk1.8.0_301 CLASSPATH: %JAVA_HOME%\lib\tools.jar;%JAVA_HOME%\lib\dt.jar; PATH: %JAVA_HOME%\bin;%JAVA_HOME%\jre\bin;
public class HelloWorld { public static void main(String[] args) { String str = "Hello World!"; System.out.println("The string is: " + str); } }
javac HelloWorld.java
java HelloWorld
package cn.edu.bjut.java; public class HelloWorldWithPackage { public static void main(String[] args) { String str = "Hello World!"; System.out.println("The string is: " + str); } }
javac -d . HelloWorldWithPackage.java
java cn.edu.bjut.java.HelloWorldWithPackage
评论