¹®ÀÚ¿À» ByteÇüÀ¸·Î º¯È¯ÇÏ´Â ¿¹Á¦
DecodeTest.java
public class DecodeTest {
public static void main(String[] args) {
try {
Byte b_dec = Byte.decode("25");
Byte b_oct = Byte.decode("065"); // octal
Byte b_hex1 = Byte.decode("0x1f"); // hex
Byte b_hex2 = Byte.decode("#1e"); // hex
// Byte b_big = Byte.decode("255"); // ERROR: too big
System.out.println("parsed: " +
b_dec + "," + b_oct + "," + b_hex1 + "," + b_hex2);
} catch (NumberFormatException e) {
e.printStackTrace();
}
}
}
C:\javaExample\Wrapper\Byte>javac DecodeTest.java
C:\javaExample\Wrapper\Byte>java DecodeTest
parsed: 25,53,31,30
¹®ÀÚ¿À» ByteŬ·¡½º¸¦ ÀÌ¿ëÇÏ¿© ByteÇüÀ¸·Î º¯È¯ÇÒ ¼ö ÀÖ´Ù.
jabookÀúÀÚ¸íÇÔ |
Á¦¸ñ:¼Ò¼³°°Àº¹Ì´ÏÄÚµå ÀÛ¼ºÀÚ:Àںϸâ¹ö ÇÑâÇå |