I've got some code like this:
public abstract class Foo {
public static Foo getFoo() {
return new FooImpl();
}
abstract void DoFoo();
private class FooImpl extends Foo {
public FooImpl() { }
@Override
void DoFoo() { }
}
}
But Eclipse is telling me No enclosing instance of type Foo is accessible.
So how can I get this to work?
I attempted to make it as simple as possible to see if it would compile:
public abstract class Foo {
public static Foo getFoo() {
return new FooImpl();
}
private static class FooImpl extends Foo {
public FooImpl() { }
}
}
And I still get the same error. What am I missing?
FIXED! I changed the line return new FooImpl();
to return new Foo.FooImpl();