April 2019
Intermediate to advanced
360 pages
9h 17m
English
The Conversion class applies when there is conversion from numbers to letters (int to char). The class has a single String class variable and a constructor method that is passed to the user's input. The class has one additional method, the convertToCharacters() method. That method converts the user's input into a character array and then processes that array, one character at a time. The processing is implemented with a simple switch statement. Each numerical value, from 0 through 9, has a corresponding character. The characters are printed one at a time until the entire character array has been processed.
The first section of our Conversion class follows:
public class Conversion { // class variable public String userInput ...
Read now
Unlock full access