Java 引用类型 & 值类型
1.值类型传值,引用类型传引用Demo:public class ReferDemo { //public int x=10; /** * @param args * primitive type: number boolean type; * refer type :class 数组 */ public static void main(String[] args) { // TODO Auto-generated method stub //值类型传值,引用类型传引用,不改变原值 int x=1; set(1); System.out.println("x:"+x); String y="y"; set(y); System.out.println("y:"+y); //数组是引用类型