/**
* Class to test what sort of communication between
* inner, nested and outer classes are legal.
* This experiment does not explore access to local variables
* when a possibly anonymous class is defined in the middle of a method.
* @author Roedy Green
*/
public class Outer
{
static int osi = 1;
int oii = 2;
final static int fosi = 2;
final int foii = 4;
static int osm()
{
return 5;
}
int oim()
{
return 6;
}
class Inner
{
void iim()
{
int i = 7;
i = osi;
i = oii;
i = fosi;
i = foii;
i = osm();
i = oim();
i = Outer.osi;
i = Outer.this.oii;
i = Outer.fosi;
i = Outer.this.foii;
i = Outer.osm();
i = Outer.this.oim();
osi = i;
oii = i;
Outer.osi = i;
Outer.this.oii = i;
}
int ii = 8;
}
static class Nested
{
void iim()
{
int i = 9;
i = osi;
i = fosi;
i = osm();
i = Outer.osi;
i = Outer.fosi;
i = Outer.osm();
osi = i;
Outer.osi = i;
}
static void ism()
{
int i = 42;
i = osi;
i = fosi;
i = osm();
i = Outer.osi;
i = Outer.fosi;
i = Outer.osm();
osi = i;
Outer.osi = i;
}
int ni = 10;
static int nis = 11;
}
}