codescracker


java

Java Program to Print ASCII Values of Characters



« Previous Program Next Program »


Print ASCII Values of Characters

To print the ASCII values of all the character in Java Programming, use the number from 1 to 255 and place their equivalent character as shown in the following program.

Java Programming Code to Print ASCII Values of Characters

Following Java Program print all the ASCII values of characters :

/* Java Program Example - Print ASCII Values of Characters */
		
public class JavaProgram
{
    public static void main(String args[])
    {
	
        String ch;
        int i;
        for(i=1; i<=255; i++)
        {
            ch = new Character((char)i).toString();
            System.out.print(i+ " -> " + ch + "\t");
        }
		
    }
}

When the above Java Program is compile and executed, it will produce the following output:

Java Program print ascii values

Same Program in Other Languages

You may also like to learn and practice the same program in other popular programming languages:


« Previous Program Next Program »



Tools
Calculator

Quick Links
Signup - Login - Give Online Test