outer
outer
refers to the current instance of the class or interface that immediately contains the
immediately containing class or interface.
Usage
This example shows outer
being used to distingush a member of the Inner
class from a
member of the same name in the Outer
class:
class Outer(foo) {
String foo;
class Inner() {
variable String foo = outer.foo;
}
}
Description
Type
The type of outer
is the type of class or interface that immediately contains the
immediately containing class or interface. In the above example outer
has the type Outer
.
Legal use
Because outer
refers to the instance of the class or interface that
immediately contains the immediately containing class or interface
it cannot be used in contexts where there is no such class or interface, such as
in top level classes, interfaces, methods or values.