01 2023 档案
摘要:ArrayList集合框架: ArrayList 是一个数组队列,提供了相关的添加、删除、修改、遍历等功能 先初始化对象: ArrayList<String> list = new ArrayList<>(); 添加元素使用add()方法; 修改元素使用set()方法: 删除元素使用remove()
阅读全文
摘要:String str ="hello"; System.out.println(str); System.out.println(str+"world"); } 输出的结果是:hello helloworld 从运行结果中我们可以看到,程序运行时会额外创建一个对象,保存 "helloworld"。当
阅读全文
摘要:/*** * instanceof练习案例 */ @Test public void testInstanceOf() { String user = "xiaoqiang"; //user相当于正方形 instanceof 是不是 String 四边形 if (user instanceof St
阅读全文