Win a copy of 97 Things Every Java Programmer Should Know this week in the Java in General 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
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

How to use Java Generics

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I had a task to do some statistics by implementing two interfaces one to which defines a key and a value for the statistic and the other to define and visit a statistic collector, I have implemented the methods and done the required task but now I want to learn how to make my code generic so I have tried many ways but non of them worked for me, you can see my code below:

Here is the statistic interface:


Here is the StatisticsCollector interface:


And here is the implementations:


---------------



---------------------


Can someone help please I have been trying and trying for days and nothing is working!
 
Rancher
Posts: 3786
34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

nothing is working!


Please explain.

If you are getting error messages, please copy the full text and paste it here.
 
moose poop looks like football shaped elk poop. About the size of this tiny ad:
Devious Experiments for a Truly Passive Greenhouse!
https://www.kickstarter.com/projects/paulwheaton/greenhouse-1
    Bookmark Topic Watch Topic
  • New Topic