- Jul 9, 2003
- 291
- 0
- 0
Hi,
I haven't programmed in Java for a while and I need help with just the simple part of inputting. I know output is System.out.print, but for input I am having trouble finding the right command to do what I want to do.
Basically I want to read in a string and turn the string into an array of words.
For instance, we have input as: "The cat and dog"
I want to know how to read that line in, and access each word individually by args[0] ("The"), args[1] ("cat"), args[2] ("and"), and args[3] ("dog").
I remembered how to do it before but I forgot and I need to write a program that does simple input and output. Any help is much appreciated.
I haven't programmed in Java for a while and I need help with just the simple part of inputting. I know output is System.out.print, but for input I am having trouble finding the right command to do what I want to do.
Basically I want to read in a string and turn the string into an array of words.
For instance, we have input as: "The cat and dog"
I want to know how to read that line in, and access each word individually by args[0] ("The"), args[1] ("cat"), args[2] ("and"), and args[3] ("dog").
I remembered how to do it before but I forgot and I need to write a program that does simple input and output. Any help is much appreciated.
