This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread 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 Murach's Java Servlets and JSP this week in the Servlets 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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: implements
 
Similar Threads
Why JSP can't implement interface?
Need your help!
interface
Collections
interface and abstract class