I want to complement this fantastic video with another operator, this operator is operatior xor the signal is ^, for example imagine you have a car, this card have two possibilities automatic or hydraulic but not both. boolean isAutomatic = true; boolena isMechanic = false; if(isAutomatic == true ^ isMechanic == true) -> true result. Why... because one card have two possibilities mechanic or automatic but not both. this is the principal reason to use the operator "^", is posible to combine operator not, and and or to simulate this result, but the operator "^" simplify the code. Regards from Perú. Continue share your knowlegde my friend.
sir from your idea in 5:20 i'm build this code . . import java.util.Scanner; public class SuggestBot { public static void main(String[] args) { System.out.println("Enter true if its raining:"); System.out.println("Enter true if its cold:"); Scanner s1 = new Scanner(System.in); boolean b1 = s1.nextBoolean(); Scanner s2 = new Scanner(System.in); boolean b2 = s2.nextBoolean(); if (b1 && b2){ System.out.println("stay indoor"); } else if (b1 || b2) { System.out.println("wear a raincoat/jacket"); } else { System.out.println("you are good to go"); } } }
bro do this with programs it helps more than giving only examples
I want to complement this fantastic video with another operator, this operator is operatior xor the signal is ^, for example imagine you have a car, this card have two possibilities automatic or hydraulic but not both.
boolean isAutomatic = true;
boolena isMechanic = false;
if(isAutomatic == true ^ isMechanic == true) -> true result.
Why... because one card have two possibilities mechanic or automatic but not both.
this is the principal reason to use the operator "^", is posible to combine operator not, and and or to simulate this result, but the operator "^" simplify the code.
Regards from Perú.
Continue share your knowlegde my friend.
Good explanation. But I want bitwise and ,or and xor operators in java
What to type first before that?
Thank you
Thanks for the Video
sir from your idea in 5:20 i'm build this code
.
.
import java.util.Scanner;
public class SuggestBot {
public static void main(String[] args) {
System.out.println("Enter true if its raining:");
System.out.println("Enter true if its cold:");
Scanner s1 = new Scanner(System.in);
boolean b1 = s1.nextBoolean();
Scanner s2 = new Scanner(System.in);
boolean b2 = s2.nextBoolean();
if (b1 && b2){
System.out.println("stay indoor");
} else if (b1 || b2) {
System.out.println("wear a raincoat/jacket");
} else {
System.out.println("you are good to go");
}
}
}
It is not necessary to use scanner class multiple times if you want to take multiple inputs.
Wonderful 👍
great explanation.
very helpfull
Thanks. Please keep up the good work.
great!!
done
Great 👍😃
Troo and trooo will give me troo
best
♥
Russian?
I think Arab
Indian
Truuuuu😂
No thanks, dude.....