How to determine the character representation for a specific digit in the specified radix int Java

1 Answer

0 votes
package javaapplication1;

public class JavaApplication1 {
 
    public static void main(String[] args) {
        
        char ch1, ch2;

        ch1 = Character.forDigit(5, 10);
        System.out.println(ch1);
       
        ch2 = Character.forDigit(10, 16);
        System.out.println(ch2);
        
        ch2 = Character.forDigit(15, 16);
        System.out.println(ch2);
    }
}
 
/*
run:

5
a
f
 
*/

 



answered Sep 13, 2016 by avibootz
...