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 ;

Therefore, it is bound only to the external class, not the typical example of the external class (which you do not have). The getFoo method also seems like it should be stable, BTW - Otherwise, example 's Foo were you planning to call it?


Comments

Popular posts from this blog

c# - How to capture HTTP packet with SharpPcap -

php - Multiple Select with Explode: only returns the word "Array" -

php - jQuery AJAX Post not working -