包装类: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);
网友评论