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.)
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
We're a friendly, industry-focused community of 1.19 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.