Answer Posted / darshan
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 autoboxing 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.
| Is This Answer Correct ? | 27 Yes | 10 No |
Post New Answer View All Answers
What is meant by object oriented programming – oop?
Who is founder of java?
Explain about instanceof operator in java?
Which container method is used to cause a container to be laid out and redisplayed in java programming?
How will you add panel to a frame?
What is the purpose of a transient variable?
What is class forname?
What is the difference between compare and compareto in java?
Is it necessary for the port addresses to be unique? Explain with reason.
What is your platform?s default character encoding and how to know this?
What must a class do to implement an interface in java programming?
What design pattern you have used in your project? I answered Factory pattern, how it is implemented? What are its advantage? Do know about Abstract Factory?
What is the exact difference in between unicast and multicast object? Where we will use?
What is balanced tree in java?
What do you understand by the term string pool?