Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Command line arguments via (string[] args)

 
Matt Moore
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

I've been told that you can pass a text file to be inputted via the (String[] args) part of the main method.

eg.

java someprogram someinput.txt

Well thats what I'd like to do, how do I do it?

thanks,

Matt
 
Mike Gershman
Ranch Hand
Posts: 1272
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


This assumes the file is in the same directory as someprogram, otherwise you have to specify the path.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic