Example usage for java.lang Integer toHexString

List of usage examples for java.lang Integer toHexString

Introduction

In this page you can find the example usage for java.lang Integer toHexString.

Prototype

public static String toHexString(int i) 

Source Link

Document

Returns a string representation of the integer argument as an unsigned integer in base 16.

Usage

From source file:Main.java

public static void main(String[] args) {
    System.out.println(Integer.toHexString(1976));

    System.out.println(Integer.parseInt("7b8", 16));
}

From source file:Main.java

public static void main(String[] args) {

    System.out.println(Integer.toHexString(32));

}

From source file:Main.java

public static void main(String[] args) {
    System.out.println(Integer.toHexString(0));
    System.out.println(Integer.toHexString(10));
    System.out.println(Integer.toHexString(11));
    System.out.println(Integer.toHexString(16));
    System.out.println(Integer.toHexString(17));
    System.out.println(Integer.toHexString(100));
    System.out.println(Integer.toHexString(1000));
}

From source file:MainClass.java

public static void main(String[] arg) {
    System.out.println(Integer.toHexString(10));
    System.out.println(Integer.toHexString(20));
    System.out.println(Integer.toHexString(30));
    System.out.println(Integer.toHexString(40));
}

From source file:Main.java

public static void main(String[] args) throws Exception {
    System.out.print(Integer.toHexString(0x10000 | i).substring(1).toUpperCase());
}

From source file:Main.java

public static void main(String[] args) {
    int i = 32;//  ww w .ja v  a  2 s . c o  m

    String strHexNumber = Integer.toHexString(i);

    System.out.println(strHexNumber);
}

From source file:Main.java

public static void main(String[] argv) throws Exception {
    int i = 0xf1;
    System.out.println("i is hex " + Integer.toHexString(i));
}

From source file:WrapperDemo.java

public static void main(String[] args) {
    System.out.println("16055 in hexadecimal: " + Integer.toHexString(16055));

}

From source file:Main.java

public static void main(String[] args) throws Exception {
    int i = 42;//from  w  w w. j  av  a2 s.c  o  m
    String hexstr = Integer.toString(i, 16);
    System.out.println(hexstr);
    hexstr = Integer.toHexString(i);
    System.out.println(hexstr);

}

From source file:Main.java

public static void main(String args[]) {
    int num = 19648;

    System.out.println(num + " in binary: " + Integer.toBinaryString(num));

    System.out.println(num + " in octal: " + Integer.toOctalString(num));

    System.out.println(num + " in hexadecimal: " + Integer.toHexString(num));
}