The parameter to the method is the basic data type

 1 package method.invocation;
 2 
 3 public class TheParameterToTheMethodIsTheBasicDataType {
 4     public static void main(String[] args) {
 5         int a = 10;
 6         int b = 20;
 7         
 8         System.out.println(a+" "+b);
 9         
10         change(a, b);
11         
12         System.out.println(a+" "+b);
13     }
14     
15     public static void change(int a, int b) {
16         System.out.println(a+" "+b);
17         a = b;
18         b = a + b;
19         System.out.println(a+" "+b);
20     }
21 }

猜你喜欢

转载自www.cnblogs.com/lzp123456-/p/9692231.html