Java java.lang Boolean compareTo(Boolean b)
Description Of Boolean: compareTo(Boolean b)
Code Example Java Boolean
public class BooleanExam { public static void main(String[] args) { Boolean x = new Boolean(true); Boolean y = new Boolean(false); int a = x.compareTo(y); String str1 = "Both values are equal "; String str2 = "Object value is true"; String str3 = "Argument value is true"; if (a == 0) { System.out.println(str1); } else if (a > 0) { System.out.println(str2); } else if (a < 0) { System.out.println(str3); } } }
ไม่มีความคิดเห็น :
แสดงความคิดเห็น