Online Java Compiler By
JavaTpoint.com
public class BooleanCompareExample1 { public static void main(String[] args) { Boolean b1 = true; Boolean b2 = false; int b3 = Boolean.compare(b1,b2); if(b3==0){ System.out.println("Both values are equal"); } else if(b3>0){ System.out.println("b1 value is true"); } else{ System.out.println("b2 value is true"); } } }
Output