[Solved] On the subject of delimiters

Assuming you’re talking about java.util.Scanner, the default delimiter is whitespace. Therefore, if you enter “14 45 20 16” on the command line and then pressed the enter key, the nextInt or next call on the scanner instance would return 14. If you then call nextInt on scanner again, you get no prompting; that would immediately … Read more

[Solved] Can Java delimit input itself, without explicit delimiters?

Assuming you’re using scanner, yes, it could. The scanner operates on the notion that a regexp serves as delimiter: Each match of the regex delimits, and whatever the regexp matches is tossed out (because nobody ‘cares’ about reading the spaces or the commas or whatever). The scanner then gives you stuff in between the delimiters. … Read more

[Solved] Java reading a file into a list

There are a decent amount of ways to accomplish what you are asking, but here is one way to read a file into a program and split each line by specific delimiters into a list, while still keeping the delimiters in the sentence. All of the functionality for turning a file to a list based … Read more