summaryrefslogtreecommitdiffstats
path: root/libjava/testsuite/libjava.lang/stringconst2.java
blob: f33ee9c5b3e9cafec973e032b39cc5c5f0a73c73 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
// Test to make sure a string constant is correctly initialized.

import java.lang.reflect.*;

public class stringconst2
{
  public static final String q = "zardoz";

  public static void main (String[] args)
  {
    try
      {
	Class k = Class.forName ("stringconst2");
	Field f = k.getField ("q");
	System.out.println (f.get (null));
      }
    catch (Throwable _)
      {
      }
  }
}
OpenPOWER on IntegriCloud