Java examples for Language Basics:char
Java char is 16 bit type and used to represent Unicode characters.
Range of char is 0 to 65,536.
public class Main { public static void main(String[] args) { char ch1 = 'a'; char ch2 = 65; /* ASCII code of 'A'*/ /* w ww . ja v a 2 s . c o m*/ System.out.println("Value of char variable ch1 is :" + ch1); System.out.println("Value of char variable ch2 is :" + ch2); } }