- Java.lang - Void
- Java.lang - Throwable
- Java.lang - ThreadLocal
- Java.lang - ThreadGroup
- Java.lang - Thread
- Java.lang - System
- Java.lang - StringBuilder
- Java.lang - StringBuffer
- Java.lang - String
- Java.lang - StrictMath
- Java.lang - StackTraceElement
- Java.lang - Short
- Java.lang - SecurityManager
- Java.lang - RuntimePermission
- Java.lang - Runtime
- Java.lang - ProcessBuilder
- Java.lang - Process
- Java.lang - Package
- Java.lang - Object
- Java.lang - Number
- Java.lang - Math
- Java.lang - Long
- Java.lang - Integer
- Java.lang - InheritableThreadLocal
- Java.lang - Float
- Java.lang - Enum
- Java.lang - Double
- Java.lang - Compiler
- Java.lang - ClassLoader
- Java.lang - Class
- Java.lang - Character.UnicodeBlock
- Java.lang - Character.Subset
- Java.lang - Character
- Java.lang - Byte
- Java.lang - Boolean
- Java.lang - Home
Java.lang Package extras
Java.lang Package Useful Resources
Selected Reading
- Who is Who
- Computer Glossary
- HR Interview Questions
- Effective Resume Writing
- Questions and Answers
- UPSC IAS Exams Notes
Java.lang Boolean Class
Introduction
The java.lang.Boolean class wraps a value of the primitive type boolean in an object. An object of type Boolean contains a single field whose type is boolean.
Class Declaration
Following is the declaration for java.lang.Boolean class −
pubpc final class Boolean extends Object implements Seriapzable, Comparable<Boolean>
Field
Following are the fields for java.lang.Boolean class −
static Boolean FALSE − This is the Boolean object corresponding to the primitive value false.
static Boolean TRUE − This is the Boolean object corresponding to the primitive value true.
static Class<Boolean> TYPE − This is the Class object representing the primitive type boolean.
Class constructors
Sr.No. | Constructor & Description |
---|---|
1 |
Boolean(boolean value) This allocates a Boolean object representing the value argument. |
2 |
Boolean(String s) This allocates a Boolean object representing the value true if the string argument is not null and is equal, ignoring case, to the string "true". |
Class methods
Sr.No. | Method & Description |
---|---|
1 | This method returns the value of this Boolean object as a boolean primitive. |
2 | This method compares this Boolean instance with another. |
3 | This method 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. |
4 | This method returns true if and only if the system property named by the argument exists and is equal to the string "true". |
5 | This method returns a hash code for this Boolean object. |
6 | This method parses the string argument as a boolean. |
7 | This method returns a String object representing this Boolean s value. |
8 | This method returns a String object representing the specified boolean. |
9 | This method returns a Boolean instance representing the specified boolean value. |
10 | This method returns a Boolean with a value represented by the specified string. |
Methods inherited
This class inherits methods from the following classes −
java.lang.Object