[IX] Boolean explanation of the underlying data type

Source: Internet
Author: User

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
Parseboolean (String)
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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.