2000-07-07 20:51:48 +00:00
|
|
|
// 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));
|
|
|
|
}
|
2006-04-17 23:18:23 +02:00
|
|
|
catch (Throwable t)
|
2000-07-07 20:51:48 +00:00
|
|
|
{
|
2006-04-17 23:18:23 +02:00
|
|
|
t.printStackTrace();
|
2000-07-07 20:51:48 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|