Finding the First Match – Intro to Java Programming

Let’s return to our Alice in Wonderland example for a minute. What if I want to write a program that finds interesting words that occur in the book? A lot of the time shorter words are more common words. Maybe longer words are more interesting, and more likely to be related to the exact topic of the book. We could write a program that would help us test this. Let’s write a program that finds the first word in Alice in Wonderland that’s longer than nine characters.

Leave a Reply

Your email address will not be published. Required fields are marked *