Advertisement
therrontelford

Character to number

Nov 14th, 2017
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.29 KB | None | 0 0
  1. import java.util.Scanner;
  2. public class Exercise4_9Unicode {
  3.  
  4.     public static void main(String[] args) {
  5.         Scanner kb = new Scanner(System.in);
  6.         System.out.println("Enter a character");
  7.         String symbol = kb.nextLine();
  8.         char sym =symbol.charAt(0);
  9.        
  10.         System.out.println((int)sym);
  11.     }
  12.  
  13. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement