• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Generics - Function declaration syntax error

 
kiran J Arudi
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

static <T extends Comparable<? super T>> List<T> merge(Collection<? extends T> c1,
Collection<? extends T> c2) {

}

The function declared as shown above results in a compiler error in the highlighted text as "List cannot be resolved to a type". Any ideas how to resolve this error?

Thank you!
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Import the List class?
 
kiran J Arudi
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Silly me. David, Thank you, I had forgotten to import List package.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic