Ask your own question, for FREE!
Computer Science 22 Online
OpenStudy (anonymous):

Hi, need help with java My java program reads a input text file and does something with it After compiling in console, I want to run from the command line For example: java RecognisingPalindrome the refers to the input file. Can someone please link me to a tutorial on this. I know its got something to do with passing arguments.

OpenStudy (rsmith6559):

Assuming that you have the args ( or argv ) array of strings in main, you just index through it. main( String[] argv ) Most languages (I think Java is off by one) argv[0] is the program called, argv[1] would be file path.

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!