We add three words to the StaticWordLibrary, first correct and then jumbled. We notice that the alignment of the text seems incorrect. In Java, the alignment is not significant. We can write:
"beer", "chocolate", "coffee",
or
"beer", "chocolate", "coffee",
or
"beer", "chocolate", "coffee",
And these all mean exactly the same.
We can automatically format our code to make it look more consistent. The easiest is to type Alt+Shift+F and then the alignment will look nicer. Since white space is not significant, it is useful as a programmer to be able to read lots of different programming styles without getting confused. That way, when you move between teams and companies, you won't get stumped when you see the same code written in a slightly different way.
NetBeans marks the lines that we have changed in the margin. This makes it easy to quickly spot what has changed in a file since we last checked in our changes.
When we wrote the scrambled version of chocolate, we made a mistake in the scrambled word and only noticed that when we ran the program. It would have been better if we could find such mistakes automatically, rather than having to try answer them all - that is tedious.
We hope you enjoyed this tutorial. If you did, you will also enjoy our courses. We suggest you start with Extreme Java - Advanced Java, followed by Extreme Java - Concurrency Performance for Java 8.
We deliver relevant courses, by top Java developers to produce more resourceful and efficient programmers within their organisations.
We can help make your Java application run faster and trouble-shoot concurrency and performance bugs...