Java.lang.Character cannot be cast to java.lang.String
Discuss Java.lang.Character cannot be cast to java.lang.String in the Java Help forum on Dev Shed. Java.lang.Character cannot be cast to java.lang.String Java Help forum discussing all Java platforms - J2ME, J2SE and J2EE - as well as relevant standards, APIs and frameworks such as Swing, Servlets, JSPs, Applets, Struts, Spring, Hibernate, ANT, EJB, and other Java-related topics.
Time spent in forums: 1 Month 2 Weeks 3 Days 2 h 27 m 30 sec
Reputation Power: 1569
As Ishnid said, the solution in general is to use ToString(), which should work with any of the library classes in any case. However, this line puzzles me:
Originally Posted by Dakaa
i was trying to cast maths operators (chars * / + -) to string [...]
Just how were the operators represented (as chars or Characters, presumably), and what were you manipulating them for? Are you doing some sort of parsing of user input or of a source file of some nature?