BlackBerryForums.com : Your Number One BlackBerry Community      

»Sponsored Links



Reply
 
LinkBack Thread Tools
  (#1 (permalink)) Old
skynetchris Offline
Knows Where the Search Button Is
 
Posts: 23
Join Date: Apr 2008
Model: 7100T
PIN: N/A
Carrier: optus
Default Inner class referencing. - 07-03-2008, 02:28 AM

Hi guys, I need a lesson in J2ME! I've got two inner classes (b [extends thread] and c [extends mainscreen]) within the class A (extends UiApplication):

Code:
public class A extends UiApplication{
   private class B extends Thread {}
   private final class C extends MainScreen {}
}
I'm trying to pass a reference using the 'this' keyword reference of C (screen) to B [which is invoking UiApplication.getUiApplication().pushGlobalScreen].

I've tried
Code:
//where C c = new C()
this.C
A.this.c            
A.this.C.this
Can you guys explain why plassing a Class name reference infront of the keyword this enables access to a parent class from an inner class? Any good docs on this? Any ideas how i would solve the above problem?
   
Reply With Quote
Sponsored Links
Please Login or Register to Remove these Advertisements!

  (#2 (permalink)) Old
simon.hain Offline
CrackBerry Addict
 
Posts: 711
Join Date: Apr 2005
Location: hamburg, germany
Model: 8700
Carrier: o2
Default 07-03-2008, 02:44 AM

inner classes have access to all members of the parent class.
see javaworld for some explaination.


java developer, Devinto, hamburg/germany
   
Reply With Quote
Reply


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On






Copyright © 2004-2008 BlackBerryNews.com, BlackBerryFAQ.com, BlackBerryForums.com.
The names RIM © and BlackBerry © are registered Trademarks of Research In Motion Limited.
Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.0.1