Write a program that receives a character and displays its Unicode.
Solution:
public static void main(String[] args) {
Scanner s = new Scanner(System.in);
String str;
char ch;
System.out.print("Enter a character:");
str = s.nextLine();
ch = str.charAt(0);
System.out.print("The Unicode for the character " + ch + " is " + (int)ch + ".");
}
Subscribe to:
Post Comments (Atom)
that is cool
ReplyDelete