This discussion is archived
10 Replies Latest reply: Mar 3, 2009 9:00 AM by 807588 RSS

public static final class in class not initialized, why?

807588 Newbie
Currently Being Moderated
Hi,

I have a public static final variable in a class which is not initialized when used by an instance of the class.
public class MyClass {

    public static final MyOtherClass MOC = new MyOtherClass();

    public MyClass() { 

        this.addObject(MOC); // When debugging MOC is null, why?
        ...

    }

}
The above code represents what is happening in my code. I don't understand why MOC is null !!! I though static variables in classes where initialized before that same class could be instantiated. Am I getting this wrong?

Thanks,

J.