This week's book giveaway is in the Jython/Python forum.
We're giving away four copies of Murach's Python Programming and have Michael Urban and Joel Murach on-line!
See this thread for details.
Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

implements  RSS feed

 
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
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!