Day 1 – Java Quick Revision Notes
🔥 What is Java?
Java is a high-level, object-oriented, case-sensitive programming language. It follows “Write
Once, Run Anywhere”.
Java code → compiled to bytecode → runs on any device using JVM.
JDK (Java Development Kit)
• Full toolkit for developers.
• Contains JRE + JVM + compiler (javac) + debugger.
• You write code → JDK compiles it → produces bytecode (.class).
🧠 JVM (Java Virtual Machine)
• Executes bytecode.
• Makes Java platform-independent.
• Converts bytecode → machine code for your system.
📦 JRE (Java Runtime Environment)
• Contains JVM + libraries.
• Needed to run Java programs.
⚡ Quick Difference
JVM = Runner
JRE = Runner + Environment
JDK = Full toolkit for developers
🔤 Variables
Example: int a = 5;
• int → data type
• a → variable
• 5 → literal
Variables store values in memory. Can use _, $. No spaces or keywords allowed.
📘 Data Types (Whole Numbers)
byte – 1 byte (8 bits)
short – 2 bytes
int – 4 bytes
long – 8 bytes
➕ Operators in Java
1. Arithmetic: +, -, *, /, %
2. Assignment: =, +=, -=, *=, /=, %=
3. Comparison: ==, !=, >, <, >=, <=
4. Logical: &&, ||, !
5. Increment/Decrement: ++, --
6. Bitwise: &, |, ^, ~, <<, >>, >>>
📚 Perfect One-Day-Before-Exam Summary
✔ Java runs everywhere using JVM.
✔ JDK = Write & Compile, JRE = Run, JVM = Execute.
✔ Variables store values. int a = 5;
✔ Four main integer types: byte, short, int, long.
✔ Operators: Arithmetic, Assignment, Comparison, Logical.