I think you're getting the error because the primitive types - including 'double' - are not objects; they cannot have members, and in particular, don't have a toString() member method. Thus, you can't say price.toString(). Try Double.toString(price).
Joined: Apr 11, 2004
I can use such a method, its listed in the double class in java specs from java webbie, I've imported java.lang.Double..
I can use such a method, its listed in the double class in java specs from java webbie, I've imported java.lang.Double In Java there is double, and there is Double. The former one is a primitive type that has no methods, and the latter is a wrapper class that extends Number and Object, and subsequently has the corresponding methods. In your code, you can use either one, -- but understand the difference.