| public final class java.lang Boolean
|
Java SE 6 |
boolean in an object. An object of type
Boolean contains a single field whose type is
boolean.
In addition, this class provides many methods for
converting a boolean to a String and a
String to a boolean, as well as other
constants and methods useful when dealing with a
boolean.
| version | 1.53, 11/17/05 |
| since | JDK1.0 |
| Fields | |||
|---|---|---|---|
| final public static Boolean | TRUE The Boolean object corresponding to the primitive
value true.
| ||
| final public static Boolean | FALSE The Boolean object corresponding to the primitive
value false.
| ||
| final public static Class | TYPE Details
The Class object representing the primitive type boolean.
| ||
| Constructors | |||
|---|---|---|---|
| public | Boolean(boolean value) Details
Allocates a Boolean object representing the
value argument.
Note: It is rarely appropriate to use this constructor.
Unless a new instance is required, the static factory
| ||
| public | Boolean(String s) Details
Allocates a Boolean object representing the value
true if the string argument is not null
and is equal, ignoring case, to the string "true".
Otherwise, allocate a Boolean object representing the
value false. Examples:
| ||
| Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| public boolean | booleanValue() Details
Returns the value of this Boolean object as a boolean
primitive.
| ||||||||||
| public int | compareTo(Boolean b) Details
Compares this Boolean instance with another.
| ||||||||||
| public boolean | equals(Object obj) Details
Returns true if and only if the argument is not
null and is a Boolean object that
represents the same boolean value as this object.
| ||||||||||
| public int | hashCode() Details
Returns a hash code for this Boolean object.
| ||||||||||
| public static boolean | parseBoolean(String s) Details
Parses the string argument as a boolean. The boolean
returned represents the value true if the string argument
is not null and is equal, ignoring case, to the string
"true".
Example:
| ||||||||||
| public static String | toString(boolean b) Details
Returns a String object representing the specified
boolean. If the specified boolean is true, then
the string "true" will be returned, otherwise the
string "false" will be returned.
| ||||||||||
| public String | toString() Details
Returns a String object representing this Boolean's
value. If this object represents the value true,
a string equal to "true" is returned. Otherwise, a
string equal to "false" is returned.
| ||||||||||
| public static Boolean | valueOf(boolean b) Details
Returns a Boolean instance representing the specified
boolean value. If the specified boolean value
is true, this method returns Boolean.TRUE;
if it is false, this method returns Boolean.FALSE.
If a new Boolean instance is not required, this method
should generally be used in preference to the constructor
#Boolean(boolean), as this method is likely to yield
significantly better space and time performance.
| ||||||||||
| public static Boolean | valueOf(String s) Details
Returns a Boolean with a value represented by the
specified string. The Boolean returned represents a
true value if the string argument is not null
and is equal, ignoring case, to the string "true".
| ||||||||||
| Properties | |||||||
|---|---|---|---|---|---|---|---|
| public static boolean | getBoolean(String name) Details
Returns true if and only if the system property
named by the argument exists and is equal to the string
"true". (Beginning with version 1.0.2 of the
JavaTM platform, the test of
this string is case insensitive.) A system property is accessible
through getProperty, a method defined by the
System class.
If there is no property with the specified name, or if the specified
name is empty or null, then
| ||||||
| About DocWeb · Bundles · Export · Export All | Top 10 · Statistics · Login |
| About Sun · Contact · Privacy · Terms of Use · Trademarks | Java SE 6 · Copyright © 1994-2009 Sun Microsystems, Inc.All rights reserved. Use is subject to license terms |
![]() |
![]() |
|