• Post Reply Bookmark Topic Watch Topic
  • New Topic

Does all wrapper classes (wrappers of 8 primitive datatypes) implement Comparable interface?  RSS feed

 
narendra nath
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have an arraylist with Integers (int wrapper objects). I was able to use Collections.Sort method and was able to sort that arrayList.

but I didn't try Collections.sort on rest of the 7 wrapper objects.

Thanks
nath
 
Knute Snortum
Sheriff
Posts: 4081
112
Chrome Eclipse IDE Java Postgres Database VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's pretty easy to go into the Java docs and check. For Double you see:

So there in Implemented Interfaces is Comparable.
 
narendra nath
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks much
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!