Advertisement
AlexKondov

Java Convert to Hexadecimal

May 13th, 2014
163
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.26 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3.  
  4. public class ToHexadecimal {
  5.  
  6.     public static void main(String[] args) {
  7.         Scanner input = new Scanner(System.in);
  8.         int num = input.nextInt();
  9.         String hexNum = Integer.toHexString(num);
  10.        
  11.         System.out.println(hexNum);
  12.  
  13.     }
  14.  
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement