美文网首页
Java_包装类_Boolean

Java_包装类_Boolean

作者: 汇源可乐 | 来源:发表于2019-11-22 22:38 被阅读0次

包装类:Integer、Long、Short、Boolean、Byte、Character、Double、Float、Number
Java_包装类_Integer

public final class Boolean implements java.io.Serializable,Comparable<Boolean>

构造函数

public Boolean(boolean value) {
        this.value = value;
    }
  public Boolean(String s) {
        this(parseBoolean(s));
    }
  • hashCode
  public static int hashCode(boolean value) {
        return value ? 1231 : 1237;
    }
  • logicalAnd
public static boolean logicalAnd(boolean a, boolean b) {
        return a && b;
    }
  • logicalOr
  public static boolean logicalOr(boolean a, boolean b) {
        return a || b;
    }
  • logicalXor
  public static boolean logicalXor(boolean a, boolean b) {
        return a ^ b;
    }
  public static final Boolean TRUE = new Boolean(true);
  public static final Boolean FALSE = new Boolean(false);

相关文章

网友评论

      本文标题:Java_包装类_Boolean

      本文链接:https://www.haomeiwen.com/subject/mklcwctx.html