• Post Reply Bookmark Topic Watch Topic
  • New Topic

Comparable Interface  RSS feed

 
Bob Ivanovich
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why is it necessary to implement the comparable interface for primitive types and not for classes such as Integer, String etc . . . ?
 
Joanne Neal
Rancher
Posts: 3742
16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bob Ivanovich wrote:Why is it necessary to implement the comparable interface for primitive types and not for classes such as Integer, String etc . . . ?

Integer and String do implement the Comparable interface and primitive types cannot implement any interfaces, so I'm not quite sure what you are asking.
 
Bob Ivanovich
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I figured it out Sorry for asking too early.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!