Showing posts with label unicode. Show all posts
Showing posts with label unicode. Show all posts

Monday, 24 November 2014

Char Data Type in Java

Unicode Character Representation In Java

A brief note about the way char Data Type used in Java Language.


                        Java uses Unicode to represent characters. Unicode provides a unique number for every character. char is a 16 bit data type and it ranges from 0 to 65536. Unicode standardization makes portability easier regardless of platform, program, and language.
Unicode
                    Unicode Character Set includes the characters from most of the known languages such as Latin, Greek, Arabic, Indonesia, Hindi, Sanskrit, French, German, Finnish, Irish, Italian, Malay, Chinese, Korean, Hebrew, Japanese etc..

                    Popular Leader in the Industry such as Apple, HP, IBM, Microsoft, SAP, Sybase, Unisys and many more adopted Unicode Standard.

A program which shows all Characters in Unicode Standard


// A simple Java Program to print all Unicode Characters

public class CharactersInJava {  

    public static void main(String[] args) {

        char ch1=0;
        //16 bit Unicode ranges from 0-65536
        for (int i = 0; i < 65536; i++) {          

            System.out.print(ch1);
            ch1++;
            if ( (i % 100) == 0)

               System.out.println();              
        }      
    }
}