Online Java Compiler By
JavaTpoint.com
public class BooleanCompareToExample4 { public static void main(String[] args) { boolean b1 =true; boolean b2 =false; for(int i=0;i<10 ;i++){ if(i==5){ b2=false; break; } } int val=b1.compareTo(b2); } }
Output