• 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
  • Liutauras Vilda
  • Junilu Lacar
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Ron McLeod
  • Carey Brown
Bartenders:
  • Paweł Baczyński
  • Piet Souris
  • Vijitha Kumara

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: 3523
33
  • 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.
 
Where all the women are strong, all the men are good looking and all the tiny ads are above average:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!