Forming a hexadecimal character string JAVA

// string of uppercase hexadecimal form, two requirements are less than some complement 0

String hex = String.format("%02X",11);
        System.out.println(hex);

// hexadecimal form small string

String hex = String.format("%x",11);
        System.out.println(hex);

 

Guess you like

Origin blog.csdn.net/tianlong1569/article/details/89847304