Advertisement
DulcetAirman

codePointAt

Jul 19th, 2018
202
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.42 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class SomeClass {
  4.  
  5.   public static void main(String[] args) {
  6.     try (Scanner scanner = new Scanner(System.in)) {
  7.       System.out.println("enter a character and hit <enter> to know its Unicode code point");
  8.       String str = scanner.nextLine();
  9.       int i = str.codePointAt(0);
  10.       System.out.print(str);
  11.       System.out.print(": ");
  12.       System.out.println(i);
  13.     }
  14.   }
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement