일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | ||||
4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 | 19 | 20 | 21 | 22 | 23 | 24 |
25 | 26 | 27 | 28 | 29 | 30 | 31 |
Tags
- Eclipse
- Java5
- WebService
- Java
- 육아
- db
- 책
- 이승철
- WebLogic
- spring3.0
- OS
- php
- Swing
- Mac
- 효민이
- 미국드라마
- Programming
- Spring
- Vista
- 부동산
- PSP
- 중고
- 행복이
- ThinkFree
- 판매
- Programing
- 요리
- Ant
- 독서
- Linux
Archives
- Today
- Total
Bitaholic
10진수 숫자를 다른진수(16,8,2진수)로 변환해야할 때.... 본문
class Integer
static String toBinaryString(int i)
static String toHexString(int i)
static String toOctal(int i)
위의 메소드를 사용하면 손쉽게 변환을 할 수 있다...
== example ==
String hexResult = Integer.toHexString(15);
String binaryResult = Integer.toBinaryString(15);
String octalResult = Integer.toOctal(15);
System.out.println("hexResult = " + hexResult);
System.out.println("binaryResult = " + binaryResult);
System.out.println("octalResult = " + octalResult);
.
.
결과
hexResult = f
binaryResult = 1111
octalResult = 17
static String toBinaryString(int i)
static String toHexString(int i)
static String toOctal(int i)
위의 메소드를 사용하면 손쉽게 변환을 할 수 있다...
== example ==
String hexResult = Integer.toHexString(15);
String binaryResult = Integer.toBinaryString(15);
String octalResult = Integer.toOctal(15);
System.out.println("hexResult = " + hexResult);
System.out.println("binaryResult = " + binaryResult);
System.out.println("octalResult = " + octalResult);
.
.
결과
hexResult = f
binaryResult = 1111
octalResult = 17
Comments