Define a Wrapper Class WITH EXAMple
Answers
Answered by
3
As the name suggests, wrapper classes are objects encapsulating primitive Java types. Each Java primitive has a corresponding wrapper: boolean, byte, short, char, int, long, float, double. Boolean, Byte, Short, Character, Integer, Long, Float, Double.
Answered by
6
Answer:
A Wrapper class is a class whose object wraps or contains primitive data types. When we create an object to a wrapper class, it contains a field and in this field, we can store primitive data types. In other words, we can wrap a primitive value into a wrapper class object.
Explanation:
ex :- Use of Wrapper classes in Java.
Primitive Type Wrapper class
integer Integer
llong Long
float Float
double Double
Similar questions