| 일 | 월 | 화 | 수 | 목 | 금 | 토 | 
|---|---|---|---|---|---|---|
| 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 | 
                                        Tags
                                        
                                    
                                        
                                    - 요리
 - Vista
 - WebLogic
 - WebService
 - db
 - 판매
 - 책
 - Java
 - ThinkFree
 - spring3.0
 - 효민이
 - PSP
 - 독서
 - Swing
 - Mac
 - Programing
 - Ant
 - Spring
 - Linux
 - php
 - Java5
 - 부동산
 - OS
 - Programming
 - 이승철
 - 중고
 - 미국드라마
 - 행복이
 - Eclipse
 - 육아
 
                                        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