A basic Java console app demonstrating input/output via the console.
- See this tutorial.
- Strings, Variables, input/output to console, intialize variables/null pointer error
- Java v8, Update 161
- The Java source code is in: Introductions.java
- The Java compiled code is in: Introductions.class
- Clone repo
- On Mac, open terminal and change to the java-hello-world directory
- Run Introductions.class, see below...
java Introductions
- File name and class name must be the same name. It is case-sensitive
- Escape character, \n gives a line break
- Java concatinates strings and variables using "+"
console.printf("Hello\n");
console.printf("Hello, %s", firstName);
console.readLine();