/**
* Title: FinallyPlay
* Description: Example of using finally clause
*
* @author hollingd@cs.rpi.edu
*/
import java.util.*;
public class FinallyPlay {
public static void main(String[] args) {
// num_processed will be the number of command line
// args sucessfully processed.
int num_processed=0;
int i=0;
try {
for (i=0;i<args.length;i++) {
System.out.println(Integer.parseInt(args[i]));
}
num_processed=args.length;
} catch (Exception e) {
System.out.println("Error processing arg " + i );
} finally {
num_processed=i;
}
System.out.println("Processed " + num_processed);
}
}