# 이진수와 십육진수 #### CODE <a class='btn btn-default' href='/codes/36380'>Link</a> ``` class Binary{ private String binaryStr; public Binary(String binaryStr) { this.binaryStr = binaryStr; } public void printInfo() { System.out.println("binary: " + binaryStr); System.out.println("decimal: " + Integer.parseInt(binaryStr, 2)); int ten = Integer.parseInt(binaryStr, 2); String hexString = Integer.toHexString(ten); System.out.println("hex: " + hexString); } } public class Main { public static void main(String[] args) { String[] tests = {"1111010000010010","1011101011100010"}; for(String t : tests) { new Binary(t).printInfo(); System.out.println(); } } } ``` #### INPUT ``` ``` #### OUPUT ``` binary: 1111010000010010 decimal: 62482 hex: f412 binary: 1011101011100010 decimal: 47842 hex: bae2 ```
# 자료구조 관련 문제들은 아직 채점 확인이 되지 않습니다ㅠ 정답 예시와 동일하다면, 정답입니다!