java-logo

what is the difference between comparable and comparator

In this tutorial we will learn what is the difference between comparable and comparator interfaces , and when we need to use comparable and when we need to use comparator. Basically “what is the difference between comparable and comparator ? ” is one of the Java interview question,  and in Java we have two interfaces which are using to […]