All Questions
3 questions
1
vote
4
answers
1k
views
Why have separate keywords for 'extends' and 'implements' in Java? [closed]
Short answer that I've come to accept:
Firstly, it helps with readability, being able to see which is the superclass apart from interfaces. Secondly, though 'extends' and 'implements' do the same ...
2
votes
2
answers
2k
views
What are the justifications for annotations in a programming language? [closed]
After spending a great deal of time writing C# and looking at Java, it seems to me that annotations are just an ugly code smell that introduce another conceptual layer that could easily be replaced by ...
32
votes
4
answers
16k
views
Why is .compareTo() in an interface while .equals() is in a class in Java?
I want to know why the .compareTo() is in the Comparable interface while a method like .equals is in the Object class. To me, it seems arbitrary why a method like .compareTo() is not in the Object ...