divine1200
04-27-2005, 03:56 PM
lets say i was asked this question...
"Write a class named PrintArgs that contains a method main() that can be run from the command line that prints the arguments it receives in reverse order?"
I did this....
public class PrintArgs
{
public static void main(String[ ] args)
{
for (int i = 0; i < args.length; i++)
System.out.println(args[ i ] );
}
}
...now I was wondering how I get it to answer the question correctly? (actually print it out in reverse order.)
"Write a class named PrintArgs that contains a method main() that can be run from the command line that prints the arguments it receives in reverse order?"
I did this....
public class PrintArgs
{
public static void main(String[ ] args)
{
for (int i = 0; i < args.length; i++)
System.out.println(args[ i ] );
}
}
...now I was wondering how I get it to answer the question correctly? (actually print it out in reverse order.)