Java/Android use one obj pointer to reference 2 class -


say need global obj pointer, this:

/** ui:fragment頁面提供 */ public static fragmentpageradapter pager=null; 

at first, pointed class

public class homepageradapter extends fragmentpageradapter{...} 

but sometime, point class following

public class mylistpageradapter extends fragmentpageradapter{...} 

is possible ?

it possible. parent class reference can hold reference child class. i.e both of following statements valid:

fragmentpageradapter pager=null; pager=new homepageradapter(); pager=new mylistpageradapter(); 

Comments

Popular posts from this blog

c++ - llvm function pass ReplaceInstWithInst malloc -

java.lang.NoClassDefFoundError When Creating New Android Project -

Decoding a Python 2 `tempfile` with python-future -