Character Datatype Example Java Program


Definition

The char data type is 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).

Syntax

char varibale_name = 'any_single_charecter';

Syntax Example

char gear = 'A';

Character Datatype Example Program

class CharacterDatatype{
	public static void main(String[] args){
		char c='m';
		System.out.println("The character is: "+c);
	}
}

Sample Output

Output is:
The character is: m