摘要: 可变个数形参的格式:数据类型 ...变量名 当调用可变个数形参的方法时,传入的参数个数可以是:0个,1个,2个,,,, 可变个数形参的方法与本类中方法名相同,形参不同的方法之间构成重载 可变个数形参的方法与本类中方法名相同,形参类型也相同的数组之间不构成重载。也就是二者不能共存。 可变个数形参在方法 阅读全文
posted @ 2022-01-08 14:48 ice--cream 阅读(64) 评论(0) 推荐(0) 编辑
摘要: 重载的概念:在同一个类中,允许存在一个以上的同名方法,只要他们的参数个数或者参数类型不同即可。 package lll; public class Test { public static void main(String[] args) { OverLoad ol=new OverLoad(); 阅读全文
posted @ 2022-01-08 14:14 ice--cream 阅读(31) 评论(0) 推荐(0) 编辑
摘要: package lll; public class Test { public static void main(String[] args) { int[] arr=new int[]{-11,2,3,23,434,-122,29,7,16}; ArrayUtil util=new ArrayUt 阅读全文
posted @ 2022-01-08 12:40 ice--cream 阅读(131) 评论(0) 推荐(0) 编辑
摘要: 含义:创建的对象,没有显式的赋给一个变量名,即为匿名对象 注意:匿名对象只能调用一次 package lll; public class Test { public static void main(String[] args) { Phone p1=new Phone(); p1.sendEmai 阅读全文
posted @ 2022-01-08 11:30 ice--cream 阅读(34) 评论(0) 推荐(0) 编辑