The professional, friendly Java community. 21,500 members and growing!

The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.

a quick question . args argv.

importjava.util.*;// Import for Scanner classpublicclass test
{publicstaticvoid main(String[] args){// TO DO code application logic hereSystem.out.println("testing in progress::start");if(args.length==5)// to test number of inputs{System.out.println("correct number of inputs");//testing for input success.if( args[0].equals("hey")&& args[1].equals("-e")){System.out.println("testing in progress::current");// Create Scanner object to take input from command prompt//Scanner s=new Scanner(System.in); // Take input argv3 == keyString s = args[2];// Initialize the variable count to 0int count=0;// Convert String st to char arraychar[] c=s.toCharArray();System.out.println(s);// Loop till end of stringfor(int i=0;i<s.length();i++)//If character at index 'i' is not a space, then increment countif(c[i]!=' ') count++;//Print no.of chars other than spaces (to check space is 10 or smaller. :: yet tested)System.out.println("No.of chars other than spaces are "+count);}else{System.out.println("testing :: error");System.out.println(args[0]);}}else{System.out.println("testing in progress::end");}}}

Basically i am attempting to make use of values in argv, in string.
currently trying to read out one input to verify data.. to code for input verification. e.g argv0 to compare a particular string input e.g that args counter should be more then 0 but not more then 10