java - What's wrong with my factory? -
I've got some code like this:
public abstract class Fu {public Fixed Foo getFoo () {Return New FooImpl (); } Elixir Zero DoFoo (); FooImpl Foo {public FooImpl () {} @Override void DoFoo () {}}} extends
but I'm assuming any type of Foo Not attached in the example.
So how can I work it out?
I have tried to make it as easy as possible that it will be compiled:
public abstract class Foo {public static Foo getFoo (new) FooImpl ( ) back); } Private Static class FooImpl Foo {public} Expandes {}}}
And I still get the same error What am I missing?
Fixed! I have changed the line to new FooImpl ();
to back to the new Foo.FooImpl (); Great explanation - In short, you need to create a class
FooImpl
static
;
getFoo
method also seems like it should be stable, BTW - Otherwise, example 's Foo
were you planning to call it?
Comments
Post a Comment