PASUPATHI .M’s Post

☕ Day 5 of my 30-day Core Java journey! Today, I explored Operators in Java — the building blocks for performing calculations and comparisons in every program. Operators allow us to manipulate data and control logic easily. 💡 Types of Operators in Java 1️⃣ Arithmetic Operators → Used for mathematical operations + , - , * , / , % 🧩 Example: int a = 10, b = 3; System.out.println(a + b); // 13 System.out.println(a % b); // 1 2️⃣ Relational Operators → Compare two values == , != , > , < , >= , <= 🧩 Example: int x = 5, y = 8; System.out.println(x > y); // false 3️⃣ Logical Operators → Combine conditions && , || , ! 🧩 Example: int age = 20; System.out.println(age > 18 && age < 30); // true 4️⃣ Assignment Operators → Assign values = , += , -= , *= , /= , %= 5️⃣ Unary Operators → Work with single operands ++ , -- , + , - , ! 6️⃣ Ternary Operator → Short form of if-else 🧩 Example: int age = 18; String result = (age >= 18) ? "Adult" : "Minor"; System.out.println(result); 🎯 Takeaway: Operators make Java logical and mathematical. They form the foundation for expressions and decision-making in programs. #CoreJava #JavaLearning #PasupathiLearnsJava #JavaOperators #ProgrammingBasics

  • graphical user interface, application

To view or add a comment, sign in

Explore content categories