package com.Vence;public class 数据交换 { public class TestParam{ public void exchange(int x,int y){ System.out.println("x="+x+",y="+y); int temp=x; x=y; y=temp; System.out.println("交换后:x="+x+",y="+y); } } public static void main(String[] args){ TestParam ab= new TestParam(); int x=5; int y=10; ab.exchange(x,y); System.out.println("交换后:x="+x+",y="+y); }}
添加回答
举报
0/150
提交
取消