Showing posts with label loop to print out array. Show all posts
Showing posts with label loop to print out array. Show all posts

Monday, July 14, 2008

java main print out args - snippet

Code to print out all arguments being passed to the main method:

    public static void main(String[] args) {

//print out arguments
for (int i = 0; i < args.length; i++) {
System.out.print("args["+i+"]: " + args[i] + "\n");

}
}