Today, I'm trying to learn some features in Java 8, specific about Lambda Expressions. I create a new Comaparator like this :

```
Comparator<String> strCom = new Comparator<String>() {
    @Override
    public int compare(String o1, String o2) {
        return 0;
    }
};

```

When I read code inside Comparator interface, I have got confused. Althrough interface Comparator have two method *compare()* and *equals()*, we don't need implement all of them. I had found some reason why we don't need implement method *equals()* [here](https://stackoverflow.com/a/11758069/2865414). But i also read in javadocs 

> 
> *If your class claims to implement an interface, all methods defined by that interface must appear in its source code before the class will successfully compile*. **[What Is an Interface?](https://docs.oracle.com/javase/tutorial/java/concepts/interface.html)** 
> 
> 
> 

**So, can someone help me understand this ? Do not override *equals()* is still legal ?**