Char Data Type in Java

 
The char data type represents a single 16-bit Unicode character. It has a minimum value of ‘\u0000’ (or 0) and a maximum value of ‘\uffff’ (or 65,535 inclusive).

Program to declare and use Java primitive char variable.

/**
 * Program to declare and use Java primitive char variable.
 * @author javawithease
 */
public class DataTypeCharExample {	
  public static void main(String args[]){ 
	//Declare char type variables.
	char ch1 = 'A';
        char ch2 = 66;
 
        //Print variables value.
        System.out.println("ch1 Value :" + ch1);
        System.out.println("ch1 Value :" + ch2);
  }
}

Output:

b1 Value :100
b2 Value :20

Download this example.