COS202 Java - Top 30 Exam Revision Pack
SECTION A - Short Questions
1. What is Java? - A high-level object-oriented programming language.
2. What is JVM? - Java Virtual Machine executes bytecode.
3. What is bytecode? - Intermediate code generated after compilation.
4. What is JDK? - Java Development Kit for developing Java programs.
5. What is garbage collection? - Automatic memory management in Java.
6. Entry point of Java program? - main() method.
7. What is a class? - Blueprint for objects.
8. What is an object? - Instance of a class.
9. Purpose of new keyword? - Used to create objects.
10. Default value of int? - 0
11. Default value of boolean? - false
12. Auto imported package? - [Link]
13. What is operator? - Symbol used to perform operations.
14. What is a variable? - Storage location for data.
15. What is inheritance? - Acquiring properties from another class.
SECTION B - Theory Questions
16. Features of Java: Simple, OOP, Secure, Portable, Robust, Distributed.
17. Data types: int, float, char, boolean with examples.
18. Operators: arithmetic, relational, logical, bitwise.
19. Control statements: selection, iteration, jump.
20. Selection statements: if, if-else, switch.
21. Loop statements: for, while, do-while.
22. Difference: while checks before loop, do-while runs at least once.
23. Switch statement selects one case from many.
24. Comments: single-line (//), multi-line (/* */).
25. Escape sequences: \n, \t, \\ etc.
26. OOP concepts: Encapsulation, Inheritance, Polymorphism, Abstraction.
SECTION C - Programming Questions
27. Grade program using if-else-if based on score ranges.
28. Program to find biggest of three numbers using if-else.
29. Switch program to display month names.
30. Java program phases: Write (.java), Compile (.class), Execute (JVM).