Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* Find online more information about ASCII (American Standard Code for Information Interchange)
- * and write a program to prints the entire ASCII table of characters at the console (characters from 0 to 255).
- * Note that some characters have a special purpose and will not be displayed as expected.
- * You may skip them or display them differently. You may need to use for-loops (learn in Internet how). */
- import java.util.Locale;
- public class PrintTheASCII_Table {
- public static void main(String[] args) {
- // TODO Auto-generated method stub
- Locale.setDefault(Locale.ROOT);
- for (int i = 0; i < 256; i++) {
- if (i > 32 && i < 127 || i > 160) {
- System.out.printf("Character # %3d -> %s\n", i, (char) i);
- } else {
- System.out.printf("Character # %3d -> Unprintable symbol or space !\n", i);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement