Lets say I have a Java class, like this:
public class Example {
private Foo foo = new Foo();
private Bar bar = new Bar(this.foo);
}
Is it guaranteed that bar
will always be instantiated with a Foo
as its constructor, or is there a chance it will be instantiated with null
instead?
Is the order in which the members of a Java class are intialized guaranteed?