Just to be ornery, be sure to
test with missing elements, too:
String line = "1||3|4||6|7||9|10|11|12|13|14|15"
Seriously, this is a good exercise just for future reference even if your input will never be that messed up for this program. It can be solved with StringTokenizer, String.split or Scanner.