fork download
  1. /* package whatever; // don't place package name! */
  2.  
  3. import java.util.*;
  4. import java.lang.*;
  5. import java.io.*;
  6. import java.math.BigInteger;
  7.  
  8. /* Name of the class has to be "Main" only if the class is public. */
  9. class Ideone
  10. {
  11. public static void main (String[] args) throws java.lang.Exception
  12. {
  13. BigInteger bi1 = new BigInteger("EF", 16);
  14. byte[] ba = new byte[] {0, (byte)0xEF};
  15. BigInteger bi2 = new BigInteger(ba);
  16. System.out.println("Big Integer1 = " + bi1.toString(16));
  17. System.out.println("Big Integer2 = " + bi2.toString(16));
  18. }
  19. }
Success #stdin #stdout 0.1s 320576KB
stdin
Standard input is empty
stdout
Big Integer1 = ef
Big Integer2 = ef