Java char: char is 16 bit type and used to represent Unicode characters. Range of char is 0 to 65,536. : Character Data Type « Data Type « Java Tutorial
2. 7. 1. Java char: 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;
System.out.println("Value of char variable ch1 is :" + ch1);
System.out.println("Value of char variable ch2 is :" + ch2);
}
}
/*
Value of char variable ch1 is :a
Value of char variable ch2 is :A
*/
2. 7. Character Data Type
2. 7. 1.
Java char: char is 16 bit type and used to represent Unicode characters. Range of char is 0 to 65,536.