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
When throws keyword is used?
what do you mean by stream pipelining in java 8? Explain
Is int primitive data type?
How objects are stored in java?
What does the “static” keyword mean? Can you override private or static method in java?
What is the difference between the file and randomaccessfile classes?
What is use of set in java?
What is the effect of keeping a constructor private?
What is the platform?
What do you mean by stack?
Write a program to print all permutations of string?
What are design patterns and please explain?
What are JVM.JRE, J2EE, JNI?
What is the synonym of framework?
How do you generate random numbers in java?