• Post Reply Bookmark Topic Watch Topic
  • New Topic

Generic Method and Bound Type Parameter errors  RSS feed

 
Kishor Joshi
Ranch Hand
Posts: 674
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi I am following this article

http://docs.oracle.com/javase/tutorial/java/generics/boundedTypeParams.html

till now I have made some code

This is my Interface


and this is my class where I am using Bound Type Parameter on Generic Methods



what else I need to do both in main method and at what parameterized types I need to pass at the class?


Thanks
 
Paweł Baczyński
Bartender
Posts: 2083
44
Firefox Browser IntelliJ IDE Java Linux Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Kishor Joshi wrote:This is my Interface
Your interface?
Isn't it java.lang.Comparable? You don't have to redefine it.

Kishor Joshi wrote:what else I need to do both in main method and at what parameterized types I need to pass at the class?

I fail to see what is an issue here. That method works. You pass an array and an element to it.
Like that:
 
Kishor Joshi
Ranch Hand
Posts: 674
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Pawel

for correcting me problem solved
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!