You are here: Home / Topics / Character Demo in Java

Character Demo in Java

Filed under: Java on 2023-08-11 19:09:03

// Character example

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

 aChar++;    // increment aChar
 System.out.println("aChar :  " + aChar);
}
}

Output:

aChar and bChar : X  Y
aChar :  Y

About Author:
V
Vinay Kumar     View Profile
Hi, I am using MCQ Buddy. I love to share content on this website.