inner class referencing outer classes members

From: Murat Tasan (tasan_at_eecs.cwru.edu)
Date: 10/29/03


Date: Wed, 29 Oct 2003 17:45:29 -0500

i have an inner class and an outer class, both of which have an
identically named member. how from the inner class can i reference the
outer member? (the example code should illustrate this problem).

class Outer
{
        int x;
        class Inner
        {
                int x;
                void setOuterX(int y)
                {
                        // this.this.x = y;
                }
        }
}

the commented line gives you the idea, but i know that doesn't work (i
tried it!)...

i'm sure this is simple enough, can someone help me out?

thanks much!

murat

-- 
Murat Tasan
mxt6@po.cwru.edu
tasan@eecs.cwru.edu
murat.tasan@cwru.edu
http://genomics.cwru.edu


Relevant Pages