Helyezze át a try/catch blokkokat a cikluson
kívülre.
public static void main( String[] args ){
try {
for ( int i = 0; i < args.length; i++ ) {
System.out.println( Integer.parseInt( args[ i ] ) );
}
} catch ( NumberFormatException e ){
throw new IllegalArgumentException( e.getMessage() );
}
}
|
|