Learning Java/Introduction to Java: Difference between revisions

Content deleted Content added
Line 63:
 
The Java compiler reads basic text files. Open up a text editor like Notepad (Don't use a complex program like Word for this). Type this code, remembering that Java is case-sensitive:
<pre>public class HelloWorld
{
public static void main (String[] args) {
{
System.out.println("Hello World!");
}
}
}</pre>
Save this file as HelloWorld.java. Start your system's command line and navigate to the folder that you saved HelloWorld.java to. Type <code>javac HelloWorld.java</code>. This runs the java compiler, javac, and creates a class file, which contains the bytecode for the application. Next type <code>java HelloWorld</code>. This runs the class file that was just created by the compiler. Your console should print: