I am a generic newbie and I can not find the best way to achieve it. Please note that if I am clearly doing something wrong, feel free to tell me.
interface node & lt; T & gt; {Zero Joint (node & lieutent; t & n; node); } Square stringnode applied node & lt; String & gt; {List & lt; StringNode & gt; Data = new arreelist & lt; & Gt; (); / ** * {@ Inherit Doc} * / @ Override Public Zero AddOne (node & lieutent; string> node) {stringnode stringnode = (stringnode) node; Data.add (stringNode); }} I was hoping to find a way to avoid addOne implementation to remove StringNode from node How can the node definition be changed to achieve its function for any implementation of the public Zero addOne (StringNode node) interface? I tried to search through the questions already asked, but did not get a close match.
How could I do this:
Extends the interface node & lt; t node & lt; T & gt; & gt; {add zero (t node);} square stringnode applied node & lt; stringnode & gt; {list & lt; stringnode & gt; ; Data = New Arreelist & lt; StringNode & gt; (); / ** * {@ Inherit Doc} * / @ Override Public Zero AddOne {StringNode Node} {data.add (node);}} < / Pre> is similar to the suggestion of u-no-poo, but a bit more strict (actually Not force a node T)
Comments
Post a Comment