向一个方法的基本数据类型参数传值

class Tom{
void f(int x,double y){
x=x+1;
y=y+1;
System.out.printf("x y : %d,%3.2f\n",x,y);
}
}
public class Example4_7{
 public static void main(String args[]){
 int x=10;
 double y=12.58;
 Tom cat=new Tom();
 cat.f(x,y);
 System.out.printf("main x y: %d,%3.2f\n",x,y);
}
}

原文地址:https://www.cnblogs.com/agony/p/2979365.html