Win a copy of Svelte and Sapper in Action this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

Generic Method and Bound Type Parameter errors

 
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
 
Bartender
Posts: 2233
63
IntelliJ IDE Firefox Browser Spring Java Linux
  • 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:)
 
I think I'll just lie down here for a second. And ponder this tiny ad:
the value of filler advertising in 2020
https://coderanch.com/t/730886/filler-advertising
    Bookmark Topic Watch Topic
  • New Topic