10 Years
Discussion Span
Last Post by Pumbaa_hughes75

Yeah we aren't allowed to help with homework unless effort has been shown. But to get you started:

java myprog

is actually asking java to execute the file myprog.class so of course you must have compiled it first.
By typing:

java myprog data1 data2 data3

you cause args to store the following information:

args[0] = "data1"
args[1] = "data2"
args[2] = "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

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.