java or
int num = 9;
if (num == 1 || num == 2) {
System.out.println("Nope");
}
if (num == 1 || num == 9) {
System.out.println("Yep");
}
java or
int num = 9;
if (num == 1 || num == 2) {
System.out.println("Nope");
}
if (num == 1 || num == 9) {
System.out.println("Yep");
}
|= java operator
foo = 32; // 32 = 0b00100000
bar = 9; // 9 = 0b00001001
baz = 10; // 10 = 0b00001010
foo |= bar; // 32 | 9 = 0b00101001 = 41
// now foo = 41
foo |= baz; // 41 | 10 = 0b00101011 = 43
// now foo = 43
Operators in java
// Arithmetic operators in java
public class ArithmeticOperatorDemo
{
public static void main(String[] args)
{
int i = 25;
int j = 5;
System.out.println(i + j);
System.out.println(i - j);
System.out.println(i * j);
System.out.println(i / j);
System.out.println(i % j);
}
}
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us