I think whoever said "can't create an object of an interface" has misunderstood implementation. You can create an object of an interface, but indirectly, by implementing it. You can create a class which implements that interface, either as an ordinary (concrete) class or an anonymous class. Remember you can do this in several stages in an inheritance hierarchy, some of which stages might be abstract classes or other interfaces.
Here the Statement object "hides" an implementation of the ResultSet interface which is what is actually returned. So the statement implements the interface ResultSet and returns an object of that implementation, which is an object of ResultSet. Have a look at my
Engine and GrowingPlant examples from three years ago. Read that discussion. Find the line
and change it to
Change "Tree" to "GrwoingPlant" in all the for-each loops. See whether you can see any difference in the output.
Ad a few lines to the original classes
Add a new class
Now see what happens. Every member of the "trees" array is an instance of the GrowingPlant interface. Create the Lithops class, where the plant grows 1mm taller every time.