/import/teaching/BSc/1st/ItP
If you look there you will see a
number of files. Copy them over as you are asked in these notes.
Hello World
By tradition, the first examples shown in any new language is one which prints
"Hello World". In other words, how to print a simple message to the screen.
We will keep to this tradition, even though it is a rather outdated one.
These days, computer users tend to interact with their programs through
graphical user interfaces (GUIs) and not by typing commands into a console
window, and then typing further information diretly into that window.
However, the examples used in this course will tend to keep to this
old-fashioned approach in order to avoid the complexities involved in
programming GUIs.
Here is "Hello World" in Java:
1 class HelloWorld 2 { 3 // A program that prints the phrase "Hello World" 4 5 public static void main(String[] args) 6 { 7 System.out.println("Hello World"); 8 } 9 }