user3571012 user3571012 - 1 year ago 105
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?

Answer Source

It's simple ...

   for (int c=32; c<128; c++) {
    System.out.println(c + ": " + (char)c);
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download