JAVA Notes Form 3 – Part 1
Java Programming Notes 1. What is Java Programming Language? - High Level Language like Pascal, C, … - Object Oriented i.e. using ‘objects’ e.g. Why Java? - Object Oriented i.e. can be used from time to time - Portable i.e. run on different computers - Small in Size (memory, efficiency) - Secure - Concurrence i.e. more than one activity at a time - Used in different applications/technology i.e. Browsers, Mobiles, etc Features - Simple - Object Oriented - Platform independent (may be used easily on different computer/systems) - Safe (prohibits viruses…) - High performance (Compiled fast… recall of compilation, briefly explain Java not .exe) - Multi-threading (Multi-tasking- different tasks processed independently & at same time)
2. JAVA Programming // Construction of a JAVA program public class FirstProgram{ public static void main (String args[]){ System.out.println("Hello World"); //Prints Hello World on Screen } } Tips on the program: • • • • • • • • • • •
// Indicate a remark (comment) /* ….. */ is used for more than one line of comments class – every program begins with this (small letters) public – program available from outside the class (package – all in small letters.) static – means it can be used without creating an instance of the class void – returns no value main – the name of the method String args[] OR String[] args – the same - (S in CAPITAL) is an array of type String called args ,……- indicate scope of that section – click on open bracket i.e. { to see its closure System.out.print(“…”) – displays output on screen System.out.println(“…”) - gives output on separate line
Mr Noel Attard
Page: 1