Services Work Learn About Contact
0/10
Lesson 3 of 10

Operators & Conditions

Java uses standard operators. Conditions use if/else if/else. The ternary operator ? : provides a shorthand for simple if/else. Use == for primitive comparison and .equals() for String comparison.

JAVA
int score = 85;

if (score >= 90) {
  System.out.println("A");
} else if (score >= 80) {
  System.out.println("B");
} else {
  System.out.println("C");
}

// Ternary
String result = (score >= 60) ? "Pass" : "Fail";
🧠

Quick Quiz

Answer correctly to unlock the next lesson.

Support the mission

This learning platform is 100% free: no ads, no tracking, no paywalls. If it helped you learn something useful, you can support future lessons or donate to Doctors Without Borders, which provides emergency medical care in crisis zones worldwide.

🎉

You completed Java!

You finished all 10 lessons and quizzes. You now know the basics of Java.