10진수 <-> 2, 8, 16진수 변환
int num = 92; //10 -> 2, 8, 16 String binNum = Integer.toBinaryString(num); String octNum = Integer.toOctalString(num); String hexNum = Integer.toHexString(num); System.out.println(binNum);//1011100 System.out.println(octNum);//134 System.out.println(hexNum);//5c //2, 8, 16 -> 10 int binToDec = Integer.parseInt(binNum, 2); int octToDec = Integer.parseInt(octNum, 8); int hexToDec = Integer.parseI..
Language/Java
2021. 2. 28. 20:52