veronikaaa86

Variable In Hex Format

Jan 29th, 2018
313
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.45 KB | None | 0 0
  1. package DataTypeAndVariables;
  2.  
  3. import java.io.BufferedReader;
  4. import java.io.IOException;
  5. import java.io.InputStreamReader;
  6.  
  7. public class P04_VariableInHexFormat {
  8.     public static void main(String[] args) throws IOException {
  9.         BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
  10.  
  11.         String hex = reader.readLine();
  12.  
  13.         long hexToInt = Long.decode(hex);
  14.  
  15.         System.out.println(hexToInt);
  16.     }
  17. }
Advertisement
Add Comment
Please, Sign In to add comment