need help with command line
arguments and creating a package in java. i need to hand this in soon and obviously i cant do it can someone help me.
We will help you as soon you show us what you did so far. However, NOBODY will do your homework for you
Yeah we aren't allowed to help with homework unless effort has been shown. But to get you started:
is actually asking java to execute the file myprog.class so of course you must have compiled it first.
java myprog data1 data2 data3
you cause args to store the following information:
args = "data1" args = "data2" args = "data3"
You can find out how many elements are stored in args by using the fact that it's an array:
len = args.length;
Note that length is variable, not a method as with the String class. Well that's a good start off I'm sure :) Oh check out http://java.sun.com/docs/books/tutorial/essential/environment/cmdLineArgs.html
All the best!
thnks for the help i'll show what i've donew soon..... and hopefully you can show me wht to do frm then on... thanks