view raw
user3571012 user3571012 - 7 months ago 49
Java Question

How to print an ASCII table?

I'm trying to print an ASCII table with each number and its corresponding value, but I don't know how to get the character associated with the number.

public static void main(String[] args) {

for(char letter= ' ';letter<274;letter++)

How can I print the associated character with the number?


It's simple ...

   for (int c=32; c<128; c++) {
    System.out.println(c + ": " + (char)c);