#Day3 of #90DaysChallenge | #OperatorsInJava | Practical Guide
Welcome to Day 3 of the 90 Days Challenge! 🎉 Today, we're diving deep into operators in Java. Whether you're a beginner or brushing up on your skills, this practical guide will help you understand and apply various operators in your Java programs.
In this video, we'll cover:
1. Arithmetic Operators
Perform basic mathematical operations:
int a = 10;
int b = 5;
System.out.println("Addition: " + (a + b)); // 15
System.out.println("Subtraction: " + (a - b)); // 5
System.out.println("Multiplication: " + (a * b)); // 50
System.out.println("Division: " + (a / b)); // 2
System.out.println("Modulus: " + (a % b)); // 0
2. Relational Operators
Compare values in Java:
System.out.println(a b); // true
System.out.println(a b); // false
System.out.println(a == b); // false
System.out.println(a != b); // true
3. Logical Operators
Make decisions based on multiple conditions:
boolean x = true;
boolean y = false;
System.out.println(x && y); // false
System.out.println(x || y); // true
System.out.println(!x); // false
4. Assignment Operators
Assign and modify values:
int c = 10;
c += 5; // c = c + 5;
System.out.println(c); // 15
5. Unary and Ternary Operators
Simplify your code:
int d = 5;
System.out.println(++d); // 6 (Unary Operator)
String result = (d 5) ? "Greater" : "Lesser";
System.out.println(result); // "Greater" (Ternary Operator)
This hands-on session will include these and other examples to help solidify your understanding. Make sure to follow along and try out the examples on your own!
🔔 Don't forget to subscribe to stay updated with the rest of the challenge. Let's build a solid foundation in Java together!
#day3 of #90dayschallenge in Programming with Java
Social media Links:
Youtube Channel Link: / @kysupportdev
Facebook Page Link: / ksupportdev
Instagram Page Link: / kysupportdev