-
1 Attachment(s)
help with this ?
hi
i need help with this calculator i am working on in java. i don't understand why it isn't working
C:\Documents and Settings\Kole\My Documents\Programming\Java\Calculator\Assignment\Kalkulator.java:409: double cannot be dereferenced
sX = dX.toString();
^
1 error
Exit code: 1
There were errors
:confused:
-
I am just learning java so I amy have this wrong but I pretty sure this code
Code:
sX = dX.toString();
should read
Code:
sX = String.ValueOf(dX).toString();
I got the same error you did so I change the above line of code to wrap the String class.
Hope that helps,
Jerel
-
public static String valueOf(double d) returns a String so there is no need to add in the extra toString().