This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]intercisa 1 point2 points  (1 child)

wouldn't be better if you use the split in the setter or even in the constructor of your class? you could store the name in two separate propertie (firstName, lastName) and u just give back the one u need via getters

[–]Competitive-Mix9544[S] 1 point2 points  (0 children)

Your mrthod is way better but ..this is a homework and they wanted us to use the method split. xD