Computer Applications
Which methods return Wrapper class objects from primitive values ?
Java Library Classes
7 Likes
Answer
The methods which return Wrapper class objects from primitive values are as follows:
- Byte.valueOf()
- Short.valueOf()
- Integer.valueOf()
- Long.valueOf()
- Float.valueOf()
- Double.valueOf()
Answered By
4 Likes
Related Questions
What is autoboxing ? What is auto-unboxing ? How are these useful ?
Which methods return primitive values from Wrapper class objects?
Predict the output.
int res = Integer.valueOf("100").compareTo(new Integer(100)); System.out.println(res);Find the error:
Integer obj = new Integer("A"); System.out.println(obj);