Reviewer for Java Programming under the TVL-ICT track.
1
Syntax & Data Types
| Type | Holds | Example |
|---|---|---|
| int | whole numbers | int x = 5; |
| double | decimals | double y = 3.14; |
| boolean | true/false | boolean ok = true; |
| String | text | String s = "Hi"; |
โ ๏ธ Common Mistake
Java is case-sensitive and every statement ends with a semicolon (;).
2
Control Structures
Use if/else for decisions and for/while for loops.
for (int i = 0; i < 5; i++) { System.out.println(i); }
3
Object-Oriented Programming
Java is OOP-based. Core pillars: Encapsulation, Inheritance, Polymorphism, Abstraction. A class is a blueprint; an object is an instance.
๐ก Exam Hack
Remember the four pillars as "A PIE": Abstraction, Polymorphism, Inheritance, Encapsulation.
4
Worked Example
public class Hello {
public static void main(String[] args) {
System.out.println("Hello!");
}
}
public static void main(String[] args) {
System.out.println("Hello!");
}
}
Every Java program starts running from the main method.
๐ Quick Recap โ Master These
Before your exam, make sure you can confidently explain and apply each of the following:
- Syntax & Data Types
- Control Structures
- Object-Oriented Programming
- Worked Example
Re-read any section above where you hesitate.