SlideShare a Scribd company logo
Programming in Java
Lecture 9: Wrapper Classes
By
Ravi Kant Sahu
Asst. Professor
Lovely Professional University, PunjabLovely Professional University, Punjab
Introduction
 Most of the objects collection store objects and not primitive
types.
 Primitive types can be used as object when required.
 As they are objects, they can be stored in any of the collection
and pass this collection as parameters to the methods.
Ravi Kant Sahu, Asst. Professor @ Lovely Professional University, Punjab (India)
Wrapper Class
 Wrapper classes are classes that allow primitive types to be
accessed as objects.
 Wrapper class is wrapper around a primitive data type because
they "wrap" the primitive data type into an object of that class.
Ravi Kant Sahu, Asst. Professor @ Lovely Professional University, Punjab (India)
What is Wrapper Class?
 Each of Java's eight primitive data types has a class dedicated
to it.
 They are one per primitive type: Boolean, Byte, Character,
Double, Float, Integer, Long and Short.
 Wrapper classes make the primitive type data to act as objects.
Ravi Kant Sahu, Asst. Professor @ Lovely Professional University, Punjab (India)
Primitive Data Types and Wrapper Classes
Data Type Wrapper Class
byte Byte
short Short
int Integer
long Long
char Character
float Float
double Double
boolean Boolean
Ravi Kant Sahu, Asst. Professor @ Lovely Professional University, Punjab (India)
Difference b/w Primitive Data Type and
Object of a Wrapper Class
 The following two statements illustrate the difference between
a primitive data type and an object of a wrapper class:
int x = 25;
Integer y = new Integer(33);
Ravi Kant Sahu, Asst. Professor @ Lovely Professional University, Punjab (India)
Ravi Kant Sahu, Asst. Professor @ Lovely Professional University, Punjab (India)
 The first statement declares an int variable named x
and initializes it with the value 25.
 The second statement instantiates an Integer object. The
object is initialized with the value 33 and a reference to the
object is assigned to the object variable y.
Ravi Kant Sahu, Asst. Professor @ Lovely Professional University, Punjab (India)
 Clearly x and y differ by more than their values:
x is a variable that holds a value;
y is an object variable that holds a reference to an object.
 So, the following statement using x and y as declared above
is not allowed:
int z = x + y; // wrong!
Ravi Kant Sahu, Asst. Professor @ Lovely Professional University, Punjab (India)
 The data field in an Integer object is only accessible using the
methods of the Integer class.
 One such method is intValue() method which returns an int
equal to the value of the object, effectively "unwrapping" the
Integer object:
int z = x + y.intValue(); // OK!
Ravi Kant Sahu, Asst. Professor @ Lovely Professional University, Punjab (India)
What is the need of Wrapper Classes?
 Wrapper classes are used to be able to use the primitive data-
types as objects.
 Many utility methods are provided by wrapper classes.
To get these advantages we need to use wrapper classes.
Ravi Kant Sahu, Asst. Professor @ Lovely Professional University, Punjab (India)
What is the need of Wrapper Classes?
 There are three reasons that we might use a Number object rather
than a primitive:
 As an argument of a method that expects an object (often used
when manipulating collections of numbers).
 To use constants defined by the class, such as MIN_VALUE and
MAX_VALUE, that provide the upper and lower bounds of the
data type.
 To use class methods for converting values to and from other
primitive types, for converting to and from strings, and for
converting between number systems (decimal, octal,
hexadecimal, binary).
Ravi Kant Sahu, Asst. Professor @ Lovely Professional University, Punjab (India)
Boxing and Unboxing
 The wrapping is done by the compiler.
 if we use a primitive where an object is expected, the compiler boxes the
primitive in its wrapper class.
 Similarly, if we use a number object when a primitive is expected, the
compiler un-boxes the object.
Example of boxing and unboxing:
 Integer x, y; x = 12; y = 15; System.out.println(x+y);
 When x and y are assigned integer values, the compiler boxes the integers
because x and y are integer objects.
 In the println() statement, x and y are unboxed so that they can be added as
integers.
Ravi Kant Sahu, Asst. Professor @ Lovely Professional University, Punjab (India)
Numeric Wrapper Classes
 All of the numeric wrapper classes are subclasses of the
abstract class Number .
 Short, Integer, Double and Long implement Comparable
interface.
Ravi Kant Sahu, Asst. Professor @ Lovely Professional University, Punjab (India)
Features of Numeric Wrapper Classes
 Provides a way to store primitive data in an object.
 All numeric wrapper classes implement typeValue() method.
 This method returns the value of the object as its primitive
type.
 byteValue(), intValue(), floatValue(), doubleValue() etc.
 Example:
int a = 10; System.out.println(a.floatValue());
Ravi Kant Sahu, Asst. Professor @ Lovely Professional University, Punjab (India)
Features of Numeric Wrapper Classes
 All the numeric wrapper classes provide a method to convert a
numeric string into a primitive value.
public static type parseType (String Number)
 parseInt()
 parseFloat()
 parseDouble()
 parseLong()
…
Ravi Kant Sahu, Asst. Professor @ Lovely Professional University, Punjab (India)
Features of Numeric Wrapper Classes
 All the wrapper classes provide a static method toString to
provide the string representation of the primitive values.
public static String toString (type value)
Example:
public static String toString (int a)
Ravi Kant Sahu, Asst. Professor @ Lovely Professional University, Punjab (India)
Features of Numeric Wrapper Classes
 All numeric wrapper classes have a static method valueOf,
which is used to create a new object initialized to the value
represented by the specified string.
public static DataType valueOf (String s)
Example:
Integer i = Integer.valueOf (“135”);
Double d = Double.valueOf (“13.5”);
Ravi Kant Sahu, Asst. Professor @ Lovely Professional University, Punjab (India)
Methods implemented by subclasses of Number
 Converts the value of the Number object to the
primitive data type returned.
byte byteValue()
short shortValue()
int intValue()
long longValue()
float floatValue()
double doubleValue()
Ravi Kant Sahu, Asst. Professor @ Lovely Professional University, Punjab (India)
Methods implemented by subclasses of Number
 Compares this Number object to the argument.
int compareTo(Byte anotherByte)
int compareTo(Double anotherDouble)
int compareTo(Float anotherFloat)
int compareTo(Integer anotherInteger)
int compareTo(Long anotherLong)
int compareTo(Short anotherShort)
 returns int after comparison (-1, 0, 1).
Ravi Kant Sahu, Asst. Professor @ Lovely Professional University, Punjab (India)
Methods implemented by subclasses of Number
boolean equals(Object obj)
 Determines whether this number object is equal to the
argument.
 The methods return true if the argument is not null and is an
object of the same type and with the same numeric value.
Ravi Kant Sahu, Asst. Professor @ Lovely Professional University, Punjab (India)
Numeric Type Wrapper Classes
 All of the numeric type wrappers inherit the abstract class Number.
 Number declares methods that return the value of an object in each of the
different number formats. These methods are shown here:
byte byteValue( )
double doubleValue( )
float floatValue( )
int intValue( )
long longValue( )
short shortValue( )
 For example, doubleValue( ) returns the value of an object as a double,
floatValue( ) returns the value as a float, and so on.
 These methods are implemented by each of the numeric type wrappers.
Ravi Kant Sahu, Asst. Professor @ Lovely Professional University, Punjab (India)
Integer Class
Constructors:
 Integer(i) : constructs an Integer object equivalent to the
integer i
 Integer(s) : constructs an Integer object equivalent to the
string s
Class Methods:
 parseInt(s) : returns a signed decimal integer value equivalent
to string s
 toString(i) : returns a new String object representing the
integer i
Ravi Kant Sahu, Asst. Professor @ Lovely Professional University, Punjab (India)
Instance Methods of Integer Class
 byteValue() : returns the value of this Integer as a byte
 doubleValue() : returns the value of this Integer as an double
 floatValue() : returns the value of this Integer as a float
 intValue() : returns the value of this Integer as an int
 longValue() : returns the value of this Integer as a long
 shortValue() : returns the value of this Integer as a short
 toString() : returns a String object representing the value
of this Integer
Ravi Kant Sahu, Asst. Professor @ Lovely Professional University, Punjab (India)
Character Class
 Character is a wrapper around a char.
 The constructor for Character is :
Character(char ch)
Here, ch specifies the character that will be wrapped by the
Character object being created.
 To obtain the char value contained in a Character object, call
charValue( ), shown here:
char charValue( );
 It returns the encapsulated character.
Ravi Kant Sahu, Asst. Professor @ Lovely Professional University, Punjab (India)
Boolean Class
 Boolean is a wrapper around boolean values.
 It defines these constructors:
Boolean(boolean boolValue)
Boolean(String boolString)
 In the first version, boolValue must be either true or false.
 In the second version, if boolString contains the string “true”
(in uppercase or lowercase), then the new Boolean object will
be true. Otherwise, it will be false.
Ravi Kant Sahu, Asst. Professor @ Lovely Professional University, Punjab (India)
 To obtain a boolean value from a Boolean object, use
booleanValue( ), shown here:
boolean booleanValue( )
 It returns the boolean equivalent of the invoking
object.
Ravi Kant Sahu, Asst. Professor @ Lovely Professional University, Punjab
Ravi Kant Sahu, Asst. Professor @ Lovely Professional University, Punjab (India)

More Related Content

PPS
Wrapper class
PPTX
Constructor in java
PPTX
JAVA AWT
PDF
Java String
PDF
Class and Objects in Java
PPTX
Constructor in java
Wrapper class
Constructor in java
JAVA AWT
Java String
Class and Objects in Java
Constructor in java

What's hot (20)

PPTX
Basic Concepts of OOPs (Object Oriented Programming in Java)
PPTX
Variables in python
PPT
Object and class
PPTX
Constructors in C++
ODP
Python Modules
PPSX
Data Types & Variables in JAVA
PPTX
Java packages
PPTX
Java - Generic programming
PPTX
Constructor overloading & method overloading
PDF
Chapter 02: Classes Objects and Methods Java by Tushar B Kute
PPT
Java interfaces
PPTX
6. static keyword
PPT
Oops in Java
PDF
Java IO
PPT
Generics in java
PPT
Abstract class in java
PPTX
Java string handling
PPTX
Inheritance in java
PPTX
Encapsulation C++
PDF
JavaScript - Chapter 12 - Document Object Model
Basic Concepts of OOPs (Object Oriented Programming in Java)
Variables in python
Object and class
Constructors in C++
Python Modules
Data Types & Variables in JAVA
Java packages
Java - Generic programming
Constructor overloading & method overloading
Chapter 02: Classes Objects and Methods Java by Tushar B Kute
Java interfaces
6. static keyword
Oops in Java
Java IO
Generics in java
Abstract class in java
Java string handling
Inheritance in java
Encapsulation C++
JavaScript - Chapter 12 - Document Object Model
Ad

Viewers also liked (20)

PPT
Wrapper class (130240116056)
PPTX
L9 wrapper classes
PPT
wrapper classes
PDF
Dependencies, dependencies, dependencies
PDF
Banking structure of india and united kingdom(1)
PPTX
Vectors in Java
PDF
PDF
Methods and constructors
PDF
Keywords and classes
PPT
JavaYDL15
ODP
Itt1 sd uml and oo
PDF
OO & UML
PDF
Basic IO
PDF
L2 datatypes and variables
PDF
Exception handling
PPTX
Java String
PPT
PDF
String handling(string buffer class)
PDF
Event handling
PDF
Packages
Wrapper class (130240116056)
L9 wrapper classes
wrapper classes
Dependencies, dependencies, dependencies
Banking structure of india and united kingdom(1)
Vectors in Java
Methods and constructors
Keywords and classes
JavaYDL15
Itt1 sd uml and oo
OO & UML
Basic IO
L2 datatypes and variables
Exception handling
Java String
String handling(string buffer class)
Event handling
Packages
Ad

Similar to Wrapper classes (20)

PDF
Wrapper classes
PDF
Java keywords
PDF
Generics
PDF
Collection framework
PDF
String handling(string class)
PDF
String handling(string class)
PPTX
Classes objects in java
PPT
Eo gaddis java_chapter_06_5e
PPT
Eo gaddis java_chapter_06_5e
PPT
Eo gaddis java_chapter_06_Classes and Objects
PDF
PDF
Inheritance
PPTX
Java tutorial part 3
PPTX
DAY_1.3.pptx
PDF
String handling(string buffer class)
PDF
What is a constructorAns)A constructor is also type of method whi.pdf
PDF
List classes
PDF
Lecture20 vector
PPT
Eo gaddis java_chapter_08_5e
PPT
Eo gaddis java_chapter_08_5e
Wrapper classes
Java keywords
Generics
Collection framework
String handling(string class)
String handling(string class)
Classes objects in java
Eo gaddis java_chapter_06_5e
Eo gaddis java_chapter_06_5e
Eo gaddis java_chapter_06_Classes and Objects
Inheritance
Java tutorial part 3
DAY_1.3.pptx
String handling(string buffer class)
What is a constructorAns)A constructor is also type of method whi.pdf
List classes
Lecture20 vector
Eo gaddis java_chapter_08_5e
Eo gaddis java_chapter_08_5e

More from Ravi_Kant_Sahu (9)

PDF
Common Programming Errors by Beginners in Java
PDF
Gui programming (awt)
PDF
Event handling
PDF
Classes and Nested Classes in Java
PDF
Operators in java
PDF
Control structures in Java
PDF
Swing api
PDF
Genesis and Overview of Java
Common Programming Errors by Beginners in Java
Gui programming (awt)
Event handling
Classes and Nested Classes in Java
Operators in java
Control structures in Java
Swing api
Genesis and Overview of Java

Recently uploaded (20)

PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
Approach and Philosophy of On baking technology
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PPTX
Cloud computing and distributed systems.
PPTX
MYSQL Presentation for SQL database connectivity
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
NewMind AI Monthly Chronicles - July 2025
PPTX
A Presentation on Artificial Intelligence
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PPTX
Big Data Technologies - Introduction.pptx
PDF
CIFDAQ's Market Insight: SEC Turns Pro Crypto
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
Digital-Transformation-Roadmap-for-Companies.pptx
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Unlocking AI with Model Context Protocol (MCP)
Approach and Philosophy of On baking technology
Chapter 3 Spatial Domain Image Processing.pdf
Diabetes mellitus diagnosis method based random forest with bat algorithm
Cloud computing and distributed systems.
MYSQL Presentation for SQL database connectivity
Reach Out and Touch Someone: Haptics and Empathic Computing
NewMind AI Monthly Chronicles - July 2025
A Presentation on Artificial Intelligence
Dropbox Q2 2025 Financial Results & Investor Presentation
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Big Data Technologies - Introduction.pptx
CIFDAQ's Market Insight: SEC Turns Pro Crypto
Network Security Unit 5.pdf for BCA BBA.
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Mobile App Security Testing_ A Comprehensive Guide.pdf
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf

Wrapper classes

  • 1. Programming in Java Lecture 9: Wrapper Classes By Ravi Kant Sahu Asst. Professor Lovely Professional University, PunjabLovely Professional University, Punjab
  • 2. Introduction  Most of the objects collection store objects and not primitive types.  Primitive types can be used as object when required.  As they are objects, they can be stored in any of the collection and pass this collection as parameters to the methods. Ravi Kant Sahu, Asst. Professor @ Lovely Professional University, Punjab (India)
  • 3. Wrapper Class  Wrapper classes are classes that allow primitive types to be accessed as objects.  Wrapper class is wrapper around a primitive data type because they "wrap" the primitive data type into an object of that class. Ravi Kant Sahu, Asst. Professor @ Lovely Professional University, Punjab (India)
  • 4. What is Wrapper Class?  Each of Java's eight primitive data types has a class dedicated to it.  They are one per primitive type: Boolean, Byte, Character, Double, Float, Integer, Long and Short.  Wrapper classes make the primitive type data to act as objects. Ravi Kant Sahu, Asst. Professor @ Lovely Professional University, Punjab (India)
  • 5. Primitive Data Types and Wrapper Classes Data Type Wrapper Class byte Byte short Short int Integer long Long char Character float Float double Double boolean Boolean Ravi Kant Sahu, Asst. Professor @ Lovely Professional University, Punjab (India)
  • 6. Difference b/w Primitive Data Type and Object of a Wrapper Class  The following two statements illustrate the difference between a primitive data type and an object of a wrapper class: int x = 25; Integer y = new Integer(33); Ravi Kant Sahu, Asst. Professor @ Lovely Professional University, Punjab (India)
  • 7. Ravi Kant Sahu, Asst. Professor @ Lovely Professional University, Punjab (India)  The first statement declares an int variable named x and initializes it with the value 25.
  • 8.  The second statement instantiates an Integer object. The object is initialized with the value 33 and a reference to the object is assigned to the object variable y. Ravi Kant Sahu, Asst. Professor @ Lovely Professional University, Punjab (India)
  • 9.  Clearly x and y differ by more than their values: x is a variable that holds a value; y is an object variable that holds a reference to an object.  So, the following statement using x and y as declared above is not allowed: int z = x + y; // wrong! Ravi Kant Sahu, Asst. Professor @ Lovely Professional University, Punjab (India)
  • 10.  The data field in an Integer object is only accessible using the methods of the Integer class.  One such method is intValue() method which returns an int equal to the value of the object, effectively "unwrapping" the Integer object: int z = x + y.intValue(); // OK! Ravi Kant Sahu, Asst. Professor @ Lovely Professional University, Punjab (India)
  • 11. What is the need of Wrapper Classes?  Wrapper classes are used to be able to use the primitive data- types as objects.  Many utility methods are provided by wrapper classes. To get these advantages we need to use wrapper classes. Ravi Kant Sahu, Asst. Professor @ Lovely Professional University, Punjab (India)
  • 12. What is the need of Wrapper Classes?  There are three reasons that we might use a Number object rather than a primitive:  As an argument of a method that expects an object (often used when manipulating collections of numbers).  To use constants defined by the class, such as MIN_VALUE and MAX_VALUE, that provide the upper and lower bounds of the data type.  To use class methods for converting values to and from other primitive types, for converting to and from strings, and for converting between number systems (decimal, octal, hexadecimal, binary). Ravi Kant Sahu, Asst. Professor @ Lovely Professional University, Punjab (India)
  • 13. Boxing and Unboxing  The wrapping is done by the compiler.  if we use a primitive where an object is expected, the compiler boxes the primitive in its wrapper class.  Similarly, if we use a number object when a primitive is expected, the compiler un-boxes the object. Example of boxing and unboxing:  Integer x, y; x = 12; y = 15; System.out.println(x+y);  When x and y are assigned integer values, the compiler boxes the integers because x and y are integer objects.  In the println() statement, x and y are unboxed so that they can be added as integers. Ravi Kant Sahu, Asst. Professor @ Lovely Professional University, Punjab (India)
  • 14. Numeric Wrapper Classes  All of the numeric wrapper classes are subclasses of the abstract class Number .  Short, Integer, Double and Long implement Comparable interface. Ravi Kant Sahu, Asst. Professor @ Lovely Professional University, Punjab (India)
  • 15. Features of Numeric Wrapper Classes  Provides a way to store primitive data in an object.  All numeric wrapper classes implement typeValue() method.  This method returns the value of the object as its primitive type.  byteValue(), intValue(), floatValue(), doubleValue() etc.  Example: int a = 10; System.out.println(a.floatValue()); Ravi Kant Sahu, Asst. Professor @ Lovely Professional University, Punjab (India)
  • 16. Features of Numeric Wrapper Classes  All the numeric wrapper classes provide a method to convert a numeric string into a primitive value. public static type parseType (String Number)  parseInt()  parseFloat()  parseDouble()  parseLong() … Ravi Kant Sahu, Asst. Professor @ Lovely Professional University, Punjab (India)
  • 17. Features of Numeric Wrapper Classes  All the wrapper classes provide a static method toString to provide the string representation of the primitive values. public static String toString (type value) Example: public static String toString (int a) Ravi Kant Sahu, Asst. Professor @ Lovely Professional University, Punjab (India)
  • 18. Features of Numeric Wrapper Classes  All numeric wrapper classes have a static method valueOf, which is used to create a new object initialized to the value represented by the specified string. public static DataType valueOf (String s) Example: Integer i = Integer.valueOf (“135”); Double d = Double.valueOf (“13.5”); Ravi Kant Sahu, Asst. Professor @ Lovely Professional University, Punjab (India)
  • 19. Methods implemented by subclasses of Number  Converts the value of the Number object to the primitive data type returned. byte byteValue() short shortValue() int intValue() long longValue() float floatValue() double doubleValue() Ravi Kant Sahu, Asst. Professor @ Lovely Professional University, Punjab (India)
  • 20. Methods implemented by subclasses of Number  Compares this Number object to the argument. int compareTo(Byte anotherByte) int compareTo(Double anotherDouble) int compareTo(Float anotherFloat) int compareTo(Integer anotherInteger) int compareTo(Long anotherLong) int compareTo(Short anotherShort)  returns int after comparison (-1, 0, 1). Ravi Kant Sahu, Asst. Professor @ Lovely Professional University, Punjab (India)
  • 21. Methods implemented by subclasses of Number boolean equals(Object obj)  Determines whether this number object is equal to the argument.  The methods return true if the argument is not null and is an object of the same type and with the same numeric value. Ravi Kant Sahu, Asst. Professor @ Lovely Professional University, Punjab (India)
  • 22. Numeric Type Wrapper Classes  All of the numeric type wrappers inherit the abstract class Number.  Number declares methods that return the value of an object in each of the different number formats. These methods are shown here: byte byteValue( ) double doubleValue( ) float floatValue( ) int intValue( ) long longValue( ) short shortValue( )  For example, doubleValue( ) returns the value of an object as a double, floatValue( ) returns the value as a float, and so on.  These methods are implemented by each of the numeric type wrappers. Ravi Kant Sahu, Asst. Professor @ Lovely Professional University, Punjab (India)
  • 23. Integer Class Constructors:  Integer(i) : constructs an Integer object equivalent to the integer i  Integer(s) : constructs an Integer object equivalent to the string s Class Methods:  parseInt(s) : returns a signed decimal integer value equivalent to string s  toString(i) : returns a new String object representing the integer i Ravi Kant Sahu, Asst. Professor @ Lovely Professional University, Punjab (India)
  • 24. Instance Methods of Integer Class  byteValue() : returns the value of this Integer as a byte  doubleValue() : returns the value of this Integer as an double  floatValue() : returns the value of this Integer as a float  intValue() : returns the value of this Integer as an int  longValue() : returns the value of this Integer as a long  shortValue() : returns the value of this Integer as a short  toString() : returns a String object representing the value of this Integer Ravi Kant Sahu, Asst. Professor @ Lovely Professional University, Punjab (India)
  • 25. Character Class  Character is a wrapper around a char.  The constructor for Character is : Character(char ch) Here, ch specifies the character that will be wrapped by the Character object being created.  To obtain the char value contained in a Character object, call charValue( ), shown here: char charValue( );  It returns the encapsulated character. Ravi Kant Sahu, Asst. Professor @ Lovely Professional University, Punjab (India)
  • 26. Boolean Class  Boolean is a wrapper around boolean values.  It defines these constructors: Boolean(boolean boolValue) Boolean(String boolString)  In the first version, boolValue must be either true or false.  In the second version, if boolString contains the string “true” (in uppercase or lowercase), then the new Boolean object will be true. Otherwise, it will be false. Ravi Kant Sahu, Asst. Professor @ Lovely Professional University, Punjab (India)
  • 27.  To obtain a boolean value from a Boolean object, use booleanValue( ), shown here: boolean booleanValue( )  It returns the boolean equivalent of the invoking object. Ravi Kant Sahu, Asst. Professor @ Lovely Professional University, Punjab
  • 28. Ravi Kant Sahu, Asst. Professor @ Lovely Professional University, Punjab (India)