Java Operators: Arithmetic, Relational, Logical, Assignment, Bitwise, Ternary

View profile for Kunal Sahu

Brand partnership

🚀 Day 3 of My Java Developer Journey Strengthening Java fundamentals, today I’m sharing Operators in Java — an important concept used for calculations, comparisons, and program logic. ☕ What are Operators? Operators are symbols used to perform actions on variables and values. Common Java Operators: ➕ Arithmetic Operators → "+ - * / %" Used for mathematical calculations. Code: "int sum = 10 + 5;" 🔍 Relational Operators → "== != > < >= <=" Used to compare values. Code: "boolean result = 10 > 5;" 🔀 Logical Operators → "&& || !" Used to combine multiple conditions. Code: "boolean check = (10 > 5 && 8 > 3);" 📝 Assignment Operators → "= += -= *= /= %=" Used to assign and update values. Code: "int x = 5; x += 2;" 🔄 Increment / Decrement Operators → "++ --" Used to increase or decrease values by 1. Code: "x++;" 🧩 Bitwise Operators → "& | ^ ~ << >> >>>" Used for bit-level operations. Code: "int a = 5 & 3;" ❓ Ternary Operator → "condition ? value1 : value2" Used as a short form of if-else. Code: "String msg = age >= 18 ? "Adult" : "Minor";" Why Operators matter: ✅ Used in conditions and loops ✅ Important for problem-solving ✅ Helps build application logic ✅ Used in every Java program Currently building my skills in: Java | Spring Boot | MySQL | REST APIs | DSA Next topic: Conditional Statements in Java #Java #BackendDeveloper #SoftwareDeveloper #OpenToWork #JavaDeveloper #Programming

To view or add a comment, sign in

Explore content categories