The code below takes user inputted integers and converts them into ASCII symbols.
public class Main {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
int charCount = in.nextInt();
for (int i = 0; i < charCount; i++) {
System.out.println((char) in.nextInt());
}
}
}
Right now, it prints each character on a new line:
Input: 097 098 099
Output:
a
b
c
How can I print all the characters onto a single line?
Input: 097 098 099
Output: abc