here when we try to add ChildClass object to "list", at runtime it is not able to judge that wheather ChildClass is subclass of SubClass or if SubClass is supertype of ChildClass .
Now if i remove that line
and replace it with
Atleast the above code should work as list is referencing "arrayList" , but this also doesn't work
Now when i added the method
to class Practising_Generic
and than if i add the folowing line in main method of class Practising_Generic
this also not working
so my question is
WHATS THE USE OF UPPERBOUND WILD CARD,
and which are the scenarios where we can use it,
can anybody please give an example
It's not about not using that phrase. If you can tell us what you expected to happen, and what actually happened, it makes it much easier to work out what is going on and how best to explain it. Otherwise we can't do any better than point you at relevant articles such as this one (which might explain what you want to know).
The knights of nee want a shrubbery. And a tiny ad:
Free, earth friendly heat - from the CodeRanch trailboss