Java Program for ASCII Code | Study Table

import java.util.Scanner;
class ASCII
{
    public static void main(String args[])
    {
        Scanner scanner = new Scanner(System.in);
        System.out.print("Enter a String or Character: ");
        String str = scanner.next();
        System.out.println("The UNICODE value of "+str+" is ");
        ASCII.code(str); scanner.close();
    }

    public static int code(char ch)
    {
        return (int)(ch);
    }

    public static void code(String str)
    {
        for(int i=0; i<str.length(); i++)
        {
            char ch = str.charAt(i);
            System.out.println(ch+":"+ASCII.code(ch));
        }
    }

} 

Comments

Popular posts from this blog

Java Program for Binary to Decimal Conversion | Study Table

Binary Search Program for Java | Study Table

[ ICSE ] Write a Letter to a Bookseller, complaining that the books supplied by him were not the latest Editions, though you have paid the money according to the latest Editions as given in the Bookseller's Catalogue. Request him to send you the latest Editions of the books and assure him that you would send back the old edition books supplied by him | Study Table