Computer Applications
Which methods return primitive values from Wrapper class objects?
Java Library Classes
5 Likes
Answer
The methods which return primitive values from Wrapper class objects are as follows:
- xxxValue() methods — byteValue(), shortValue(), intValue(), longValue(), floatValue(), doubleValue().
- parseXXX methods — parseByte(), parseShort(), parseInt(), parseFloat(), parseLong(), parseDouble().
Answered By
3 Likes
Related Questions
Name some methods that are commonly available in all wrapper classes and in all numeric wrapper classes.
What is autoboxing ? What is auto-unboxing ? How are these useful ?
Which methods return Wrapper class objects from primitive values ?
Predict the output.
int res = Integer.valueOf("100").compareTo(new Integer(100)); System.out.println(res);