Erning.write()

Reloading

Java String

挺无聊的题目真的难倒不少人,

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
public class Hello {
    public static void main(String[] args) {
        String s = "123";
        System.out.println(s);
        m1(s);
        System.out.println(s);

        int i = 123;
        System.out.println(i);
        m2(i);
        System.out.println(i);
    }

    private static void m1(String s) {
        s = "321";
    }

    private static void m2(int i) {
        i = 321;
    }
}

运行结果是什么?