• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

generics again wildcards

 
Ranch Hand
Posts: 278
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
in this code snippet ,method argument Stats<? > i havent seen in any book.This is from some web site.What does it mean.
I know about (List<?> ob )or List<? extends ...> but Stats -is class here ,nt some collection .???

class Stats<T extends Number >
boolean sameAvg(Stats<?> ob) {
if(average() == ob.average())
return true;

return false;
}
}
 
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Lucky,

It seems that Stats is the user defined class only.

The Java SE API don't have any Stats class.

and, it also look like the example is not complete, as the average() method is missing in the Stats class.

Please provide some more information for this example.
 
reply
    Bookmark Topic Watch Topic
  • New Topic