- class Test1 {
- public static int leftshift(int i, int j) {
- return i=i+j;
- }
- public static void main(String args[]) {
- int i = 4;
- int j = 2;
- System.out.println(leftshift(i, j));
- }
- }
复制代码
你要的6.改一下你就知道了为什么了- class Test1 {
- public static int leftshift(int a, int b) {
- return a=a+b;
- }
- public static void main(String args[]) {
- int i = 4;
- int j = 2;
- System.out.println(leftshift(i, j));
- System.out.println(i);
- }
- }
复制代码 |