Effective Java! Consistently Use the Override Annotation

In our previous chapter we discussed creating annotations which was a lot of fun but not something that a lot of developers will find themselves doing on a day-to-day basis. Today we discuss something that you will interact with much more often. That is the @Override annotation. This annotation is quite simple but will help avoid some bugs and push detection of some of our defects to compile-time versus later in the process. To illustrate the point let us consider the following example:

public class Bigram {
private final char