SKP’s Java/Java EE Gotchas: Revisiting Java SE 9 Features, Part 1

Preparing for an interview? Want to just revisit Java SE 9 features? Trying to recollect or revise Java SE programming constructs? Let me take you back in time to what was introduced first in Java SE 9? Join me for this tutorial series on Java as we all eagerly await the official release of Java SE 14!

As I promised, I am back with the code samples of my earlier article Java SE 9... What's New? You may refer the earlier article to understand the newly introduced features at a high level. This article provides the code samples for each of the features.

You may download the code samples for the following new features here. (Import as eclipse project, set compiler/environment as Java 9. Run the main class 'Java9Application' to see the output/outcome of the Code Samples.)

I plan to start by re-visiting a Java 8 feature, Default Interface Methods.

Beware of This find Command Gotcha

find is a useful basic command that Linux users run all the time. The command searches a file system from a given starting location and returns all matches based on input filters that you provide as arguments.

The Gotcha

The gotcha is when you try to narrow the search by pruning a sub-directory from the search (including the directory itself and everything under it). For instance, suppose you want to find all files under the directory /data that are owned by root, excluding the sub-directory /data/keepit and all files underneath.