本帖最后由 j816326 于 2013-7-2 23:11 编辑
- <p><p>public class StringStaticTest {
- public static final String A; // 常量A3.
- public static final String B; // 常量B4.
- static {
- A = "ab";
- B = "cd";
- }
- public static void main(String[] args) {
-
- String s = A + B;
- String s1="abcd";</p><p></p><p> </p><p>public class StringStaticTest {
- public static final String A = "ab"; // 常量A
- public static final String B = "cd"; // 常量B4.
- public static void main(String[] args) {
- String s = A + B;
- String s1="abcd";
- }</p></p>
复制代码 他们有什么不同之处? |