boolean isJavaFun = true;
boolean isFishTasty = false;
System.out.println(isJavaFun); // Outputs true
System.out.println(isFishTasty);
class HelloWorld {
public static void main(String[] args) {
Boolean isJavaFun = true;
System.out.print(isJavaFun);
}
}
int a = 4;
int b = 5;
boolean result;
result = a < b; // true
result = a > b; // false
result = a <= 4; // a smaller or equal to 4 - true
result = b >= 6; // b bigger or equal to 6 - false
result = a == b; // a equal to b - false
result = a != b; // a is not equal to b - true
result = a > b || a < b; // Logical or - true
result = 3 < a && a < 6; // Logical and - true
result = !result; // Logical not - false
class App {
public static void main(String[] args) {
// The boolean keyword is for creating a variable with boolean data type.
boolean result = true;
System.out.println(result);
}
}