java.lang.String.split splits on regular expressions, and . in a regular expression means “any character”.
This Wont Work
String[] words = line.split(".");
This Works
String[] words = line.split("\\.");
java.lang.String.split splits on regular expressions, and . in a regular expression means “any character”.
This Wont Work
String[] words = line.split(".");
This Works
String[] words = line.split("\\.");