package day16; public class Test03 { public static void main(String[] args) { MyData m1=new MyData(); m1.num=1; change(m1); System.out.println(m1.num); } public static void change(MyData my){ //my =m1 my=new MyData(); my.num*=2; } } class Mydata{ int num; }
java代码
于 2022-09-26 11:24:27 首次发布