|
Last change
on this file since 3103 was 2, checked in by bird, 23 years ago |
|
Initial revision
|
-
Property cvs2svn:cvs-rev
set to
1.1
-
Property svn:eol-style
set to
native
-
Property svn:executable
set to
*
|
|
File size:
391 bytes
|
| Line | |
|---|
| 1 | // Test to make sure a string constant is correctly initialized.
|
|---|
| 2 |
|
|---|
| 3 | import java.lang.reflect.*;
|
|---|
| 4 |
|
|---|
| 5 | public class stringconst2
|
|---|
| 6 | {
|
|---|
| 7 | public static final String q = "zardoz";
|
|---|
| 8 |
|
|---|
| 9 | public static void main (String[] args)
|
|---|
| 10 | {
|
|---|
| 11 | try
|
|---|
| 12 | {
|
|---|
| 13 | Class k = Class.forName ("stringconst2");
|
|---|
| 14 | Field f = k.getField ("q");
|
|---|
| 15 | System.out.println (f.get (null));
|
|---|
| 16 | }
|
|---|
| 17 | catch (Throwable _)
|
|---|
| 18 | {
|
|---|
| 19 | }
|
|---|
| 20 | }
|
|---|
| 21 | }
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.