The Boolean is very simple relative to the other underlying typeBoolean Basic Data Type Boolean wrapper classan object of type Boolean contains a Boolean type of field
Introduction to Properties properties are also relatively simple
Class instance representing the base type Boolean |
public static final class<boolean> TYPE = (class<boolean>) class.getprimitiveclass ("Boolean"); |
TRUE constant |
public static Final Boolean true = new Boolean (true); |
FALSE constant |
public static Final Boolean false = New Boolean (false); |
Construction Method As usual two forms ofBasic Type/parseboolean parsing
Boolean (Boolean value) |
|
Boolean (String s) |
|
comparison method
Compare (Boolean, Boolean) |
Static Methods x=y equals 0 . x is true? 1 greater than 0 x is false?-1 less than 0 |
CompareTo (Boolean) |
Instance method Call a static method to compare the values of two objects
|
parsexxx Series string parsing is a basic type,no objects are required, so they are static methodsstring parsing is simple for Booleanbecause only true and false two kinds ofas long as the string equals True, then it is true otherwise, everything is false
valueof Series wrapping Basic Basic types as objectsused to create a Get object, so no objects are required, all static methodsvlueof Two forms, given that the Boolean itself is just two valuesso according to this value, or according to the Parseboolean valuereturns a built-in two object, TRUE FALSEThis can also be understood as a cache of two objects
Static Boolean valueOf (Boolean B) |
|
Static Boolean valueOf (String s) |
|
Xxxvalue Series gets the value of some basic type of objectneed to get the value of the object, so it must be all instance methodsBoolean only Booleanvalue () one formBecause Boolean cannot be strongly converted to another data type
toString Series
ToString (Boolean) |
Static methods Converts directly to the corresponding string form, based on true or false
|
ToString () |
Instance method
|
equals
Overridden The Equals method The internal comparison is the value of the object |
|
hashcode The boolean hashcode returns a fixed value
static int Hashcode (boolean value) |
Two fixed value |
int hashcode () |
|
getxxx Series gets the value of the system property
Getboolean (String) Get system attribute-related data and convert to Boolean logical meaning with GETXXX series in other classes |
|
Other methods Boolean will naturally have related Boolean operationsfrom the source code can be seen, is directly and or non-operational
LogicalAnd (Boolean, Boolean) |
|
Logicalor (Boolean, Boolean) |
|
Logicalxor (Boolean, Boolean) |
|
[IX] Boolean explanation of the underlying data type