首页 > 其他 > 详细

变量的值传递

时间:2017-06-20 18:36:48      阅读:284      评论:0      收藏:0      [点我收藏+]

代码如下:

package ClassDemo; public class Increment {
public static void main(String[] args) {
int x = 1;
System.out.println("Before the call, x is: " + x);
increment(x);
System.out.println("After the call, x is: " + x);
} private static void increment(int n) {
n++;
System.out.println("n inside the method is: " + n);
}
}

变量的值传递

原文:http://www.cnblogs.com/F001li/p/7055655.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!