COS202 Java - A+ Revision Notes (Likely Repeated
Questions)
SECTION A - Short Definitions
Java is an object-oriented programming language.
JVM executes Java bytecode.
Bytecode is intermediate code from compilation.
Garbage collection removes unused objects automatically.
Entry point of Java is main() method.
Class is a blueprint for objects.
Object is an instance of a class.
Inheritance uses extends keyword.
Polymorphism means many forms.
Encapsulation is data hiding.
SECTION B - Key Theory Points
Features of Java: Simple, OOP, Secure, Robust, Portable, Distributed, High Performance.
Data types: int, float, char, boolean.
Operators: arithmetic, relational, logical, bitwise.
Control statements: selection, iteration, jump.
If-else used for decision making.
Switch selects one option among many.
Loops: for, while, do-while.
Do-while executes at least once.
Comments: // single line, /* */ multi-line.
Escape sequences: \n, \t, \\.
SECTION C - Most Repeated Exam Questions
Grade program using if-else-if is frequently asked.
Find biggest of three numbers using conditional statements.
Switch program for months is a common exam question.
Loop programs (1-20 printing) are often repeated.
Voting eligibility program is a common exam question.
Java program phases: write, compile, execute.
Difference between while and do-while is often asked.
OOP concepts essay is a major Section C question.