首页javabooleanJava Data Type - 如何将布尔值转换为布尔值,使用其booleanValue方法

Java Data Type - 如何将布尔值转换为布尔值,使用其booleanValue方法

我们想知道如何将布尔值转换为布尔值,使用其booleanValue方法。
public class MainClass {

  public static void main(String[] args) {
    Boolean b1 = new Boolean(false);
    Boolean b2 = new Boolean("true");

    System.out.println(b1.booleanValue());
    System.out.println(b2.booleanValue());
  }

}