콩's EDUCATION/콩's JAVA_RUN
10진수, 2진수, 8진수, 16진수로 쉽게 바꾸기
콩쓰s
2013. 6. 27. 01:02
사실 형 변환 기초개념으로 구현 해야는데^^;;
// 형변환.
package Week1;
public class Casting {
public static void main(String[] args) {
System.out.println("=========================================");
System.out.println("10진수 2진수 8진수 16진수");
System.out.println("=========================================");
for(int i=1;i<=30;i++){
System.out.println(i+"\t"+Integer.toBinaryString(i)+"\t"+Integer.toOctalString(i)+"\t"+Integer.toHexString(i));
}
}
}