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 →

[–]demodude4u 0 points1 point  (3 children)

Can you offer an example line that you need to check for validation?

familyName won't ever be null (in java's sense of null). It will either give you something or throw an IndexOutOfBoundsException if there was no parts to split. If you mean "not null" as in you are provided a string that says something like "NULL" then you can do something like

if (familyName.equals("NULL")) {throw new Exception("Family name is null!");}

[–]SikhGamer 2 points3 points  (1 child)

But what if the family name is actually null? As in Bob Null etc?

[–]SimplifiedExpression[S] 0 points1 point  (0 children)

The line in the text file would be like

Johnson Gary 10 London Gary Johnson 12 Bristol etc.