char data type in java

Java Programming Language / Character Class in java

1618

Program:

 // Demonstrate char data type.
class CharDemo {

	public static void main(String args[]) {
	char ch1, ch2;
	ch1 = 88; // code for X
	ch2 = 'Y';
	System.out.print("ch1 and ch2: ");
	System.out.println(ch1 + " " + ch2);
	}
}

Output:

ch1 and ch2: X Y
Press any key to continue . . .

This Particular section is dedicated to Programs only. If you want learn more about Java Programming Language. Then you can visit below links to get more depth on this subject.