summaryrefslogtreecommitdiff
path: root/libjava/testsuite/libjava.lang/pr24321.java
blob: 513304b50146061247f6bdfcf60ff289b8b5a126 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
public class pr24321 {
  static class Z {
    static {
      System.out.println("init");
    }
  }

  static class Y extends Z { }

  public static Object x () { return new Object(); }

  public static void main(String[] args) throws Throwable
  {
    System.out.println(x() instanceof Z);

    ClassLoader cl = pr24321.class.getClassLoader();
    Class zk = Class.forName("pr24321$Z", false, cl);
    Class yk = Class.forName("pr24321$Y", false, cl);
    System.out.println(zk.isAssignableFrom(yk));
  }
}