source:
trunk/gcc/libjava/testsuite/libjava.lang/stringconst2.java@
3127
| Last change on this file since 3127 was 2, checked in by , 23 years ago | |
|---|---|
|
|
| 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.
