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

get url and add instance to a model with prefilled foreign key :django admin -

css - Make div keyboard-scrollable in jQuery Mobile? -

ruby on rails - Seeing duplicate requests handled with Unicorn -