Check if booleans are same


package com.demo.demo;

public class EqualBooleanDemo {
 public static void main(String[] args) {
Boolean b = true;
boolean b1 = true;
Boolean b2 = new Boolean(true);
System.out.println("b==b1 : "+(b==b1));
System.out.println("b==b2 : "+(b==b2));
System.out.println("b2==b1 : "+(b2==b1));
}
}

Comments

Popular posts from this blog

Program get max salary Female Employee in java8