Java Notes: Basics to Conditional Statements 1.
Introduction to Java Java is a high-level,
object-oriented, platform-independent programming language. Key features: Simple, Secure, Portable,
Object-Oriented, Robust, Multithreaded. 2. JVM, JRE, JDK JVM: Java Virtual Machine – runs Java
bytecode. JRE: Java Runtime Environment – JVM + libraries. JDK: Java Development Kit – JRE +
tools for development (compiler, debugger). 3. Basic Structure of a Java Program A simple program:
class Main { public static void main(String[] args) { [Link]("Hello World"); } } 4. Variables
and Data Types Primitive types: int, float, double, char, boolean, byte, short, long. Non-primitive
types: String, arrays, classes, objects. 5. Operators Arithmetic: +, -, *, /, % Relational: ==, !=, >, <,
>=, <= Logical: &&, ||, ! Assignment: =, +=, -= 6. Input in Java import [Link]; Scanner sc =
new Scanner([Link]); int x = [Link](); 7. Conditional Statements If Statement: if (condition) { //
code } If-else Statement: if (condition) { } else { } Else-if Ladder: if (...) { } else if (...) { } else { } Switch
Statement: switch(value) { case 1: break; default: } Practice Questions (Basic → Advanced) Basic Print
your name. Add two numbers. Check if number is even or odd. Find largest of two numbers.
Intermediate Find largest of three numbers. Check if a character is vowel or consonant. Write a simple
calculator using switch-case. Check if a number is positive, negative, or zero. Advanced Find the roots
of a quadratic equation. Menu-driven program: ATM operations. Grade calculator based on marks
using else-if ladder. Electricity bill calculator using conditional statements.