android - Define an attribute that extends a class in java -


i have following class:

class foo {    public void sayhello(){        system.out.println("hello");    } } 

and want class hold reference class extends foo (but can't foo). (erroneous syntax):

class bar {     private <e extends foo> e  mfoo; } 

is possible? how can without declaring in class name this?

class bar <e extends foo> {     private  e  mfoo; } 

if can make foo abstract class might solve if main point e can't instance of foo. if foo isn't abstract still do

public abstract class abstractfoo extends foo { } 

and declare e of type abstractfoo.


Comments

Popular posts from this blog

SPSS keyboard combination alters encoding -

Add new record to the table by click on the button in Microsoft Access -

javascript - jQuery .height() return 0 when visible but non-0 when hidden -