• Post Reply Bookmark Topic Watch Topic
  • New Topic

Inner Class - INSTANCE  RSS feed

 
Steve Rodgers
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

How do I call a method in Class innerA1 from Class innerA? I want to be careful and word this correctly (so Mr. Harkness doesn't reprimand me :

My Class innerA2 depends on an instance of Class innerA. I cannot subclass innerA2 as if it were a normal class. Do add a constructor to Class innerA2 with an instance of Class innerA in it? How do I call the method foo from Class innerA?!?!

Briefly, Class innerA is supposed to hold objects ot type innerA1 and innerA2.

Thanks in advance.
[ February 20, 2005: Message edited by: Steve Rodgers ]
 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
maybe something like this

 
Steve Rodgers
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That may work but it's not what I was thinking. Basically my Class InnerA1 and Class InnerA2 are beans. I just want the getter/setter methods. If I use your solution I'll have code in the beans (which I'm trying to avoid).

Sure, I could choose to not use inner classes at all but.....
[ February 20, 2005: Message edited by: Steve Rodgers ]
 
Senthil B Kumar
Ranch Hand
Posts: 160
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

[ February 28, 2005: Message edited by: kolkata prince ]
 
Steve Rodgers
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ahhhh. Very nice. Thank you both.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!