DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

+ Reply to Thread
Results 1 to 2 of 2

Hybrid View

  1. #1
    Calvin Guest

    Referencing a containg class instance from a nested class?


    In a normal class you would reference the current instance with the 'this'
    keyword. How would I refrence the same (outer class) from a nested class.
    In Java, you use the syntax <Outer Class>.this.

    Thanks in advance,
    Calvin...

  2. #2
    Jonathan Allen Guest

    Re: Referencing a containg class instance from a nested class?

    You can't, nested classes are not inherently owned by the outer class.

    One option would be to pass a pointer to the outer class to the inner =
    class's constructor.

    --=20
    Jonathan Allen



    "Calvin" <DigitalQuark@msn.com> wrote in message =
    news:3bd1ad8b$1@news.devx.com...
    >=20
    > In a normal class you would reference the current instance with the =

    'this'
    > keyword. How would I refrence the same (outer class) from a nested =

    class.
    > In Java, you use the syntax <Outer Class>.this.
    >=20
    > Thanks in advance,
    > Calvin...



Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


Top DevX Stories

Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL


Sponsored Links