mirror of
https://github.com/autc04/Retro68.git
synced 2024-11-03 07:07:20 +00:00
23 lines
413 B
Java
23 lines
413 B
Java
|
// 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 t)
|
||
|
{
|
||
|
t.printStackTrace();
|
||
|
}
|
||
|
}
|
||
|
}
|