2002-10-15 21:00:24 +02:00
|
|
|
// Test to make sure static initializers are called
|
2002-10-14 21:02:56 +02:00
|
|
|
|
|
|
|
class bar
|
|
|
|
{
|
|
|
|
public static int zog;
|
|
|
|
public static int zag;
|
|
|
|
|
|
|
|
static
|
|
|
|
{
|
|
|
|
zog = 12;
|
|
|
|
zag = 2;
|
|
|
|
}
|
|
|
|
|
|
|
|
public bar() { }
|
|
|
|
}
|
|
|
|
|
|
|
|
public class StaticConstructor
|
|
|
|
{
|
|
|
|
static int foo ()
|
|
|
|
{
|
|
|
|
return new bar().zog;
|
|
|
|
}
|
|
|
|
|
|
|
|
public static void main(String args[])
|
|
|
|
{
|
|
|
|
System.out.println ("" + (foo() + bar.zag));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|