上一页 1 ··· 28 29 30 31 32 33 34 35 36 ··· 133 下一页
摘要: Java1.5提供了一个叫varargs的新功能,就是可变长度的参数。 "Varargs"是"variable number of arguments"的意思。有时候也被简单的称为"variable arguments" 定义实参个数可变的方法:只要在一个形参的"类型"与"参数名"之间加上三个连续的 阅读全文
posted @ 2023-05-26 16:07 盘思动 阅读(26) 评论(0) 推荐(0)
摘要: ## demo1 ``` import java.util.ArrayList; import java.util.Iterator; import java.util.List; public class ImoocStudent { public static void main(String[ 阅读全文
posted @ 2023-05-26 15:36 盘思动 阅读(27) 评论(0) 推荐(0)
摘要: * Java 中的标签是为循环设计的,是为了在多重循环中方便的使用 break 和coutinue ### demo1 ``` public static void main(String[] args) throws Exception{ label:// 放在这里label,跳出外出循环 for 阅读全文
posted @ 2023-05-26 14:35 盘思动 阅读(139) 评论(0) 推荐(0)
摘要: ``` import java.text.SimpleDateFormat; import java.util.Date; public class ImoocStudent { public static void main(String[] args) throws Exception{ for 阅读全文
posted @ 2023-05-26 09:07 盘思动 阅读(17) 评论(0) 推荐(0)
摘要: ### System.out.printf() * %d 指定输出整型 * %s 指定字符串类型 * %.2f 浮点数字的格式 ![](https://img2023.cnblogs.com/blog/1202393/202305/1202393-20230525172400638-18576132 阅读全文
posted @ 2023-05-25 17:24 盘思动 阅读(73) 评论(0) 推荐(0)
摘要: * 注意:removeAll不是差集 ``` import java.util.ArrayList; public class ImoocStudent { public static void main(String args[]){ ArrayList objArray = new ArrayL 阅读全文
posted @ 2023-05-25 16:16 盘思动 阅读(94) 评论(0) 推荐(0)
摘要: * 在 Java 中,我们可以使用 ArrayList 来定义不固定长度的数组,因为 ArrayList 内部使用了一个动态数组来存储元素。 * arrayList 是动态数组 * 添加数组 ``` ArrayList intList = new ArrayList(); intList.add(1 阅读全文
posted @ 2023-05-25 15:14 盘思动 阅读(1337) 评论(0) 推荐(0)
摘要: ``` import java.util.*; public class ImoocStudent { public static void main(String args[]){ int array[] = new int[6]; Arrays.fill(array,100); for (int 阅读全文
posted @ 2023-05-25 14:34 盘思动 阅读(18) 评论(0) 推荐(0)
摘要: * 以下实例演示了如何通过 Collections 类的 Collections.max() 和 Collections.min() 方法来查找数组中的最大和最小值: ``` import java.util.Arrays; import java.util.Collections; public 阅读全文
posted @ 2023-05-25 14:12 盘思动 阅读(190) 评论(0) 推荐(0)
摘要: ![](https://img2023.cnblogs.com/blog/1202393/202305/1202393-20230525141048380-104280220.png) 阅读全文
posted @ 2023-05-25 14:10 盘思动 阅读(25) 评论(0) 推荐(0)
上一页 1 ··· 28 29 30 31 32 33 34 35 36 ··· 133 下一页