Hi,

This is weird behavior I think:

--------------------
public class Foo {
  1 => static int bar;
}

<<< Foo.bar >>>; // prints 0! Why?

Foo f;
<<< Foo.bar >>>;  // prints 1, ok

2 => Foo.bar;
<<< Foo.bar >>>;  // prints 2, ok

Foo f2;
<<< Foo.bar >>>; // prints 1 again!
--------------------

So it seems that static members get initialized only on instantiation, but to make it funky, on every instantiation...

Is this a buggy implementation of static members, or am I missing something? Not complaining, just a question. :)

Thanks!
Gonzalo
_______________________________________________
chuck-users mailing list
[email protected]
https://lists.cs.princeton.edu/mailman/listinfo/chuck-users

Reply via email to