This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes Beginning Java and the fly likes implements Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "implements" Watch "implements" New topic
Author

implements

Nick Delauney
Ranch Hand

Joined: Sep 28, 2002
Posts: 43
I thought you only used implements for interfaces. By doing so you include all the signatures of the methods to the interface, as well as any primitave values.
However I was looking at the interface Comparable. It seems it can implement all the classes that represent primitive objects ?
Kind of confusing to me, can anyone help shed some light ?
Thanks,


N.D:"Anything worth having, takes time to get"
John Smith
Ranch Hand

Joined: Oct 08, 2001
Posts: 2937
However I was looking at the interface Comparable. It seems it can implement all the classes that represent primitive objects?
An interface doesn't implement a class, it's the other way around. Regarding the Comparable, if you want to be able to compare the instances of a class based on some criteria, you simply implement the Comparable interface by providing the implementation of the compareTo(Object o) method in that class.
Eugene.
[ April 21, 2003: Message edited by: Eugene Kononov ]
Nick Delauney
Ranch Hand

Joined: Sep 28, 2002
Posts: 43
Thanks again Eugene
 
jQuery in Action, 2nd edition
 
subject: implements