//cd d:\JavaTry\Application1 //javac Hexa2.java //set CLASSPATH=. //java Hexa2 15 class Hexa2 { public static void main(String[] args) { String s= args[0]; int n=Integer.valueOf(s).intValue(); System.out.println("Decimal: " + s ); System.out.println("Binary: " + Integer.toBinaryString(n)); System.out.println("Hexa: " + Integer.toHexString(n).toUpperCase()); } } /* D:\JavaTry\Application1>java Hexa2 15 Decimal: 15 Binary: 1111 Hexa: f コマンドライン引数を忘れると下記エラー。 C:\JavaTry\Application1>java Hexa2 Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 0 at Hexa2.main(Hexa2.java:8) */