In principle, the idea of type classes is present even in Java. For example, Java has the Comparator interface, which defines how to compare two arbitrary types. It defines a relationship of order on a type. The type that is used with collections defines the order in which they are sorted.
However, a language such as Java lacks a mechanism for applying that class to types conveniently. So, for example, when you are sorting a collection, you need to explicitly provide an instance of the type class to the sorting method. This is unlike Scala, where it is possible to use implicit conversions and implicit lookup for the compiler to look up the implementation of the type class by itself, so as not to clutter the code.
In Scala, the compiler is much smarter than in Java, in part due to the presence of the implicit resolution mechanism. So, when we...