[TIL] 2022.12.01

rara_kim·2022년 12월 1일
0

TIL

목록 보기
22/25

오늘은

오늘은 간단한 API설계 시험을 봤다.
이번주에 제출한 개인과제가 기반이되는 시험이었기 때문에 어렵지는 않았다.
그런데 내일부터 주특기 숙련주차가 시작되기 되는데, 이런 난이도 정도 밖에 소화를 못하는데 숙련주차로 가도 괜찮은가? 싶은 의구심이 마구 들기 시작했다... 열심히 공부하자!!

💡기억해두기

프로그래머스 Level0 문제를 풀이하며 새로 알게 된 내용 정리!

10진수 -> 2진수,8진수,16진수

int i = 127;
String binaryString = Integer.toBinaryString(i);
String octalString = Integer.toOctalString(i);
String hexString = Integer.toHexString(i);

System.out.println(binaryString);   //1111111
System.out.println(octalString);    //177
System.out.println(hexString);      //7f

2진수,8진수,16진수 -> 10진수

int binaryToDecimal = Integer.parseInt(binaryString, 2);
int binaryToOctal = Integer.parseInt(octalString, 8);
int binaryToHex = Integer.parseInt(hexString, 16);

System.out.println(binaryToDecimal);   //127
System.out.println(binaryToOctal);     //127
System.out.println(binaryToHex);       //127

profile
느리더라도 꾸준하게

0개의 댓글