StaticConstructor.java: New.
2002-10-14 Andrew Haley <aph@redhat.com> * libjava.lang/StaticConstructor.java: New. * libjava.lang/StaticConstructor.out: New. From-SVN: r58131
This commit is contained in:
parent
f4e3e61878
commit
006941eb2f
@ -1,3 +1,8 @@
|
||||
2002-10-14 Andrew Haley <aph@redhat.com>
|
||||
|
||||
* libjava.lang/StaticConstructor.java: New.
|
||||
* libjava.lang/StaticConstructor.out: New.
|
||||
|
||||
2002-10-13 Mark Wielaard <mark@klomp.org>
|
||||
|
||||
* libjava.mauve/xfails: Remove tests that now XPASS.
|
||||
|
29
libjava/testsuite/libjava.lang/StaticConstructor.java
Normal file
29
libjava/testsuite/libjava.lang/StaticConstructor.java
Normal file
@ -0,0 +1,29 @@
|
||||
g// Test to make sure static initializers are called
|
||||
|
||||
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));
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user