Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

implements

 
Nick Delauney
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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,
 
John Smith
Ranch Hand
Posts: 2937
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 43
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks again Eugene
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic