I've made a program that takes arguments from the command prompt. I use the args as conditions for if statements. Now I want to give from 2 to 4 arguments. The problem is that my array gives an Arrayindexoutofboundsexception if I want to give for example only 2 arguments since my if statements contain conditions for args and args aswell.
Joined: Apr 28, 2004
args.length will tell you the number of arguments. Remember that args is a totally standard java array of Strings.
Get a better web browser:<br /><a href="http://www.mozilla.org/products/firefox/switch.html" target="_blank" rel="nofollow">http://www.mozilla.org/products/firefox/switch.html</a>