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.
Thanks for the Video
Wonderful 👍
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.
Thank you
Good explanation. But I want bitwise and ,or and xor operators in java
Thanks. Please keep up the good work.
great explanation.
What to type first before that?
very helpfull
Great 👍😃
great!!
Troo and trooo will give me troo
done
best
♥
Russian?
I think Arab
Indian
Truuuuu😂
No thanks, dude.....