0
public int countArguments( String args[] ) {

        logger.debug( "In countArguments(..)" );
                     
            String [] readArray= new String [10];
            for ( int i=0; i<readArray.length;  i++ ) {
                for(int count: readArray){ 
                 count=count+i;
                System.out.println( "Number of arguments = " + count );
                }
            }
        
    }

Edited by Ezzaral: Added code tags. Please use them to format all code that you post.

2
Contributors
3
Replies
4
Views
6 Years
Discussion Span
Last Post by Vaspar
0

No need for such looops
args.length use this to display how many arguments were entered...

0

Thanks alot it is working now....

public void countArguments( String args[] ) {

        logger.debug( "In countArguments(..)" );
                     
        if ( args.length == 0 ) {

            System.out.println(
                    "No arguments were passed to this application" );
        }
        else {           

                System.out.println( "The number of arguments passed = " + args.length );
            
        }
            
    }

Edited by Ezzaral: Added code tags. Please use them to format all code that you post.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.