Hi, I'm currently working on a java program for my class and am needing some information. I've been coding in java fro about 2 years now and am totally stumped right now. Normally I write a program in a Program.java file, then compile it (javac Program.java) and then run it (java Program). Sometimes I require command line arguments, which is just (java Program filename).
The program I'm writing right now is slightly different. The instructor says:
Quote:
The command line usage for your program should look exactly as follows:
login_name filename
where filename is the name of a file that contains the definition of the grocery packing problem.
Is there some way to make a program recognize that "login_name" is the same as "java Program"???
I assume... even though I shouldn't... that he will have a directory containing all the students programs, and I may have to rewrite my program so that everything is in 1 file, because right now it's broken up into 5 or 6, and rename that file as login_name, then compile it and submit the .class file, but that's a huge assumption. and even if that's true, is there a way for you program to recognize that if it's called by its name (login_name) that it does java login_name. Im so confused.
Please help, I can't find anything on such things in any of my java resources.