标签:change logs [] i++ system class package bug pac
//断点调试,记住:方法中的变量在调用完之后会消失 package cn.debug; public class DuanDian { public static void main(String[] args) { int a = 10; int b = 20; System.out.println(a + "-----" + b); change(a, b); System.out.println(a + "-----" + b); int[] arr = { 1, 2, 3, 4, 5 }; change(arr); System.out.println(arr[1]); } public static void change(int a, int b) { a = b; b = a + b; System.out.println(a + "-----" + b); } public static void change(int[] arr) { for (int i = 0; i < arr.length; i++) { if (arr[i] % 2 == 0) { arr[i] = arr[i] * 2; } } } }
标签:change logs [] i++ system class package bug pac
原文地址:http://www.cnblogs.com/yuanyuan2017/p/6561424.html