OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [libjava/] [testsuite/] [libjava.lang/] [StaticConstructor.java] - Rev 765

Compare with Previous | Blame | View Log

// 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));
  }
}
 
 

Compare with Previous | Blame | View Log

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.