Win a copy of Escape Velocity: Better Metrics for Agile Teams this week in the Agile and Other Processes 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Tim Cooke
  • Paul Clapham
  • Jeanne Boyarsky
Sheriffs:
  • Ron McLeod
  • Frank Carver
  • Junilu Lacar
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Frits Walraven
  • fred rosenberger

inheritance in generics

 
Ranch Hand
Posts: 658
2
Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
here i read some rules to follow while implementing generic interface but many are incorrect.
1. Only generic classes can implement generic interfaces. Normal classes can’t implement generic interfaces. // INCORRECT
2. A normal class can implement a generic interface if type parameter of generic interface is a wrapper class. //INCORRECT

i am saying this incorrect on behalf of my this code which is compiling fine .


many more points are incorrect . Can anyone correct me if i am wrong and can someone please refer me a good source where i can read this inheritance in generics topic. doc.racle doesn't have
 
author
Posts: 23928
142
jQuery Eclipse IDE Firefox Browser VI Editor C++ Chrome Java Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Puspender Tanwar wrote:
i am saying this incorrect on behalf of my this code which is compiling fine .

many more points are incorrect.


Do you happen to have a T class (meaning a class named T, and not a generic) in your classpath?

Henry
 
Puspender Tanwar
Ranch Hand
Posts: 658
2
Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Henry Wong wrote:Do you happen to have a T class (meaning a class named T, and not a generic) in your classpath?
Henry


yes.
Means, for the T type parameter here , compiler assuming the class which i named T. As i have saved both the files in same folder(which is indirectly same package) ??

now i have deleted that class and compiler is now complaining "cannot find symbol T"
Thank you Henry
 
joke time: What is brown and sticky? ... ... ... A stick! Use it to beat this tiny ad!
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic