首页 > 编程语言 > 详细

java method 方法的参数与返回值

时间:2015-01-13 10:30:51      阅读:568      评论:0      收藏:0      [点我收藏+]
public class TestJava4_9 {
public static void main(String args[]) {
int num;
num = star(7);
System.out.println(num+" stars printed");
}

public static int star(int n) {
for (int i = 1; i < 2*n; i++) {
System.out.print("*");
}
System.out.print("\n");
return 2*n;
}
}

java method 方法的参数与返回值

原文:http://blog.csdn.net/lua_denis_2014/article/details/42672815

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