functional interfaces in java

Functional Interfaces

You’ve probably heard of a functional interface before, often in the same breath as lambdas. What are functional interfaces, and why are they used with lambdas?

Lambdas and functional interfaces go hand in hand in Java.

A functional interface is simply an interface that has a single abstract method. Before Java 8, they were referred to as SAM interfaces.

Why are these interfaces so important that they have their own term? Two reasons:

Continue reading
Drawing of a cannon

Canonical classes in Java

You may have heard of canonical classes before. But what are they actually?

No, they’ve got nothing to do with cannons – I just chose that image for fun. In computer science, the term “canonical” means conforming to well-established patterns or rules.  (The word canonical is from Latin and means “according to rule” – a meaning applied to religion during the Middle Ages.)

Continue reading