CharToString.java: Declare a character variable (char ch). Read a character into the variable ch and then store it in a String variable using the valueOf method. Print out both the char and string value at the end to test your program.
(Note that the valueOf method is static... this means that the method can be called without an instance of the class. Therefore you can say String.valueOf, this is similar to how you’ve used the random method in the math class.)
Answered by JamesCherrill 4,667 in a post from
Jump to Post
There are lots of people here who will freely give their time to help you become the best Java programmer you can be. There's nobody here who is interested in helping you cheat or doing your homework for you.
DaniWeb Member Rules (which you agreed to when you signed up) …
All 3 Replies
JamesCherrill 4,667 Most Valuable Poster Team Colleague Featured Poster
stultuske 1,116 Posting Maven Featured Poster
jwenting 1,889 duckman Team Colleague
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.