- 博客(6)
- 收藏
- 关注
原创 2020-12-27
方法的参数传递 参数为基本数据类型的情况 public class tmp{ public static int Sum1(int n, int s){ return n * ( n + 1 ) / 2; } public static void main(String[] args){ int s1 = 0; int n1 = 5; s1 = Sum1(n1); System.
2020-12-27 21:32:06 67
原创 2020-12-27
方法的参数传递 2.参数为引用类型的情况 class B //类B { private int n; //私有成员变量 public B(int n1){ //重载构造方法 n = n1; } public void add(){ //方法add() n++; } public int getn(){
2020-12-27 21:17:36 98 1
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人