What is the Comparable interface in JAVA?
Answers
Answered by
0
Two interfaces with same methodshaving same signature but different return types. Java does not support multiple inheritance but we can achieve effect of multiple inheritance using interfaces. In interfaces, a class can implement more than one interfacewhich can't be done through extends keyword.
Answered by
0
- Comparable , represents an object which can be compared to other objects. For instànce, numbers can be compared, strings can be compared using alphabetical comparison etc.
- Several of the built-in classes in Java implements the Java Comparable interface.
Similar questions