class ReverseArgs { static public void main(String[] arg) { Stack stack = new Stack(); //push all of the args onto a stack for (int i=0; i<arg.length; i++) { stack.push(arg[i]); } //pop them all off in reverse order while (stack.notEmpty()) { System.out.print( stack.pop() + " " ); } System.out.println(); } }