To get started, you will code the "Hello World" program. The hello world program is the prototypical first Java program. When executed, it prints the text "hello world" onto your console. Many programmers venturing into new languages create a hello world program to demonstrate the basic ability to compile and execute code in that new language environment.
I include "hello world" here solely as a quick means of feedback. Many of the concepts in it are more advanced topics that you will learn later in the book. This exercise exists to ensure you are able to compile and execute Java programs. For now, type the code below, exactly as it appears, into your IDE or editor. class Hello { public static void main(String[] args) { System.out.println("hello world"); } } Save this using the filename Hello.java. Case is important in Java. If you save it as hello.java, you may not be able to compile or execute the code.[2]
|