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
Can a class have multiple constructors?
Can an arraylist be empty?
What about interrupt() method of thread class ?
What is xslt in java?
What is string array?
What are filterstreams?
What purpose do the keywords final, finally, and finalize fulfill?
How do you create a method in java?
Explain the difference between throw and throws in java?
how we can use debug in myeclipse 6.0 in order solve the problems that exist in our program when there are 900 to 1000 pages in a web application
How do you join strings in java?
What is jit and its use?
Explain about java sdk?
How objects of a class are created if no constructor is defined in the class?
What is a treeset in java?