Boolean class

The Boolean class wraps a primitive type boolean in an object. An object of type Boolean contains a single field whose type is boolean.

Boolean class has the methods for converting a boolean to a String and a String to a boolean.

TypeFieldSummary
static BooleanFALSEThe Boolean object value false.
static BooleanTRUEThe Boolean object value true.
static Class<Boolean>TYPEThe Class object representing the primitive type boolean.

Convert to primitive boolean value

ReturnMethodSummary
booleanbooleanValue()Returns the value as a boolean primitive.

ConstructorSummary
Boolean(boolean value)Creates a Boolean object for value.
Boolean(String s)Creates a Boolean object true value for string "true" igoring case.

Compare two boolean values

ReturnMethodSummary
intcompareTo(Boolean b)Compares this Boolean instance with another.
booleanequals(Object obj)Returns true if the argument is not null and is a Boolean object that represents the same boolean value as this object.

Get boolean system property

ReturnMethodSummary
static booleangetBoolean(String name)Gets system property.

Parse boolean value from string

ReturnMethodSummary
static booleanparseBoolean(String s)Parses the string argument as a boolean.
static BooleanvalueOf(boolean b)Returns a Boolean instance representing the specified boolean value.
static BooleanvalueOf(String s)Returns a Boolean with a value represented by the specified string.

Convert boolean value to string

ReturnMethodSummary
StringtoString()Returns a String object representing this Boolean's value.
static StringtoString(boolean b)Returns a String object representing the specified boolean.
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.