"No enclosing instance of type ... is available due to some intermediateconstructor invocation."

Discussion in 'Java' started by -, Jul 2, 2005.

  1. -

    - Guest

    I have this error "No enclosing instance of type ... is available due to
    some intermediate constructor invocation." for a class with this structure:

    public abstract class A1 extends A {

    public A1(Object o) {
    super(o);
    }

    public class B1 extends B {

    public B1(Object o) {
    super(o); <---- error here
    }
    }

    private class B extends A1 {

    public B(Object o) {
    super(o);
    }
    }
    }
     
    -, Jul 2, 2005
    #1
    1. Advertising

  2. -

    - Guest

    Re: "No enclosing instance of type ... is available due to some intermediateconstructorinvocation."

    - wrote:
    > I have this error "No enclosing instance of type ... is available due to
    > some intermediate constructor invocation." for a class with this structure:
    >
    > public abstract class A1 extends A {
    >
    > public A1(Object o) {
    > super(o);
    > }
    >
    > public class B1 extends B {
    >
    > public B1(Object o) {
    > super(o); <---- error here
    > }
    > }
    >
    > private class B extends A1 {
    >
    > public B(Object o) {
    > super(o);
    > }
    > }
    > }


    nvm.. 'static' is the answer.
     
    -, Jul 2, 2005
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.

Share This Page