The parseDouble () method is used to initialize STRING (which should contain some numeric value) .... the return value is of primitive data type, for example, int, float, etc.
But valueOf () creates an object of class Wrapper. You must expand it to get a double value. It can be compared to chocolate. The manufacturer wraps the chocolate with foil or paper to prevent contamination. The user accepts the chocolate, removes and throws the wrapper and eats it.
Pay attention to the following conversion.
int k = 100; Integer it1 = new Integer(k);
The int k data type is converted to an object, it1, using the Integer class. The it1 object can be used in Java programming, where k requires an object.
The following code can be used to expand (return an int from an Integer object) of the it1 object.
int m = it1.intValue();
System.out.println (m * m); // prints 10000
// intValue () is an Integer class method that returns an int data type.
rohanpro Jun 25 '14 at 6:20 2014-06-25 06:20
source share