hexcalc.java:119: toString() in java.lang.Object cannot be applied to
(float)
System.out.println (Math.toString(theExp));
^
1 error
theExp is of type float
Any help would be greatly appreciated!
Thanks
Jack
Siam - 20 Mar 2008 20:56 GMT
> hexcalc.java:119: toString() in java.lang.Object cannot be applied to
> (float)
> System.out.println (Math.toString(theExp));
> ^
> 1 error
What are you trying to do? To print the float,
System.out.println(theExp) will do. The toString method is a non-
static method (which takes no arguments) that you call on objects...
You've called it it statically on the Math class, passing it a
primitive... Thats why the compiler's complained!
Lasse Reichstein Nielsen - 20 Mar 2008 21:39 GMT
> hexcalc.java:119: toString() in java.lang.Object cannot be applied to
> (float)
> System.out.println (Math.toString(theExp));
> ^
> 1 error
> theExp is of type float
As was already said, just
System.out.println(theExp)
will do.
You might have been thinking of
Float.toString(float)
There is no Math.toString(float).
/L

Signature
Lasse Reichstein Nielsen - lrn@hotpop.com
DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleDOM.html>
'Faith without judgement merely degrades the spirit divine.'
Roedy Green - 21 Mar 2008 00:42 GMT
>hexcalc.java:119: toString() in java.lang.Object cannot be applied to
>(float)
> System.out.println (Math.toString(theExp));
see http://mindprod.com/applet/converter.html
for how to interconvert all the common types.

Signature
Roedy Green Canadian Mind Products
The Java Glossary
http://mindprod.com