|
-
May 16th, 2007, 12:17 PM
#1
Thread Starter
Lively Member
help with java
sorry for lack of a descriptive title, but I don't know how to describe my problem!
I'm looking to do this:
I have a program called "program" It is run via the command "java" in the command line. I have 3 strings in it: string "a", string "b", and string "c". Here's what I need to have happen:
When the user enters "java program duck cow moose". I want "duck" to be stored in string "a", "cow" to be stored in string "b", and "moose" to be stored in string "c". Also, If the person only enters "java program duck cow", then I want "duck" to be stored in string "a", "cow" to be stored in string "b", and for string "c" to remain empty.
I have no idea how to go about this... I know how to make it so user input goes into a string, but only after the program is running. How do I do it in the way I described?
Thanks,
stettybet0
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|