1

Okay, so I'm not entirely sure what I'm doing here.

I have an assignment that requires that I read files called student.txt and classes.txt as well as a couple others and from those create a grade report.

However in my assignment it is required that "file names “student.txt” and “classes.txt” must be passed to the program through command line arguments." I'm not entirely sure what this means.

Throughout my programming class we've been running NetBeans IDE and I honestly don't ever remember him mentioning command line arguments (although I did miss a day last week).

I've looked up tons of tutorials online but anything I've seen has been about using user entered arguments and not files so I have absolutely no idea what to do.

3
  • 3
    Command line arguments are specified as parameters to the main method. See docs.oracle.com/javase/tutorial/essential/environment/… . Every IDE (like Netbeans) should have a way to specify these arguments - consult the documentation for your IDE Commented Apr 27, 2015 at 18:16
  • I don't understand what you don't understand about the requirement. The strings for the file names need to be passed in as command line arguments. The tutorial provided by Oracle here is pretty straight forward and even has an example passing in a file name. What specifically did you not understand? Without telling us, we're likely to give you the same explanations you didn't understand already. Commented Apr 27, 2015 at 18:18
  • 1
    possible duplicate of stackoverflow.com/questions/9168759/… Commented Apr 27, 2015 at 18:21

1 Answer 1

0

I googled "netbeans command line arguments" and found a very helpful article: http://netbeanside61.blogspot.com/2009/02/using-command-line-arguments-in.html

It not only describes how to use NetBeans to pass command line arguments to a Java program, it also demonstrates how to access those arguments from your Java code.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.