9th final pratice
🌟 JAVA QUICK REVISION – FULL EXAM NOTE 🌟 (Read Carefully – High Scoring Concepts) 🔹 1. Encapsulation Encapsulation means wrapping data (variables) and methods (functions) together into a single unit called a class . It is achieved by: Declaring variables as private Providing access through public getter and setter methods Example: class Student { private int marks; public void setMarks(int m) { marks = m; } public int getMarks() { return marks; } } 🔹 2. Comparison Operator → == Used to compare two values. Returns true or false . Example: if (a == b) 🔹 3. Loop That Runs At Least Once → do-while Condition is checked after execution. Executes minimum one time even if condition is false. Example: do { System.out.println("Hello"); } while(condition); 🔹 4. Constant Variable Keyword → final Once assigned, value cannot be changed . final int x = 10; 🔹 5. Math.sqrt(16) → 4 Math.sqrt() returns square root. System.out.println(Math.s...