Answer Posted / sandeep sagala
A primitive wrapper class in the Java programming language
is one of eight classes provided in the java.lang package to
provide object methods for the eight primitive types. All of
the primitive wrapper classes in Java are immutable. J2SE
5.0 introduced auto boxing of primitive types into their
wrapper object, and automatic unboxing of the wrapper
objects into their primitive value—the implicit conversion
between the wrapper objects and primitive values.
Wrapper classes are used to represent primitive values when
an Object is required. The wrapper classes are used
extensively with Collection classes in the java.util package
and with the classes in the java.lang.reflect reflection
package.
The primitive wrapper classes and their corresponding
primitive types are:
Primitive type Wrapper class Constructor Arguments
byte Byte byte or String
short Short short or String
int Integer int or String
long Long long or String
float Float float, double or String
double Double double or String
char Character char
boolean Boolean boolean or String
The Byte, Short, Integer, Long, Float, and Double wrapper
classes are all subclasses of the Number class.This Number
class is subject to the object class
| Is This Answer Correct ? | 6 Yes | 2 No |
Post New Answer View All Answers
Can we write class inside a class in java?
What are unchecked exceptions in java?
What is the use of a conditional inclusion statement in Java ?
What is the statements?
Can you add null to a list java?
Can we increase array size dynamically in java?
What is the syntax and characteristics of a lambda expression? Explain
Can we define static methods inside interface?
Explain access specifiers?
What data type is string java?
How many bytes is a char in java?
What is the most important feature of java? What is an interface?
Explain the use of shift operator in java. Can you give some examples?
extending thread class or implementing runnable interface. Which is better? : Java thread
Define a package.