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