• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

number of arguments

 
rani bedi
Ranch Hand
Posts: 358
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How can you count the number of command line arguments supplied at runtime?
 
Bosun Bello
Ranch Hand
Posts: 1510
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Assuming your main method starts as follows..
public static void main(String args[])
The length of the args array should give you what you need.
System.out.println(args.length).
Bosun
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic