- #1
csgirl504
- 18
- 0
Homework Statement
I just have a quick question and hope I can ask it clearly. If I am writing a constructor for a class that takes in one value as an argument, but the value is two words, how can I extract the first and second word?
For example, if I wrote a class called Name and my constructor looked like this:
Name(String firstLast)
And the value sent in was John Smith
How would I extract John and store it in its own variable? Is this even possible?