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.)
quackyeji 0 Newbie Poster
JamesCherrill 4,733 Most Valuable Poster Team Colleague Featured Poster
stultuske 1,116 Posting Maven Featured Poster
jwenting 1,905 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.