上一页 1 ··· 5 6 7 8 9

2022年3月19日

一些关于泛型模模糊糊的地方

摘要: public class Something { public static void main(String[] args) { ArrayList<Animal> list = new ArrayList<Animal>(); list.add(new Tiger()); }}class Ani 阅读全文

posted @ 2022-03-19 23:16 我要当程序源 阅读(16) 评论(0) 推荐(0) 编辑

经典题目 (锻炼编程能力)

摘要: 定义 Employee类 定义MyDate 类 year , month , day( 相关get set tostring ) 该类包含 属性name , sal , birthday , 其中birthday是MyDate类型 创建三个对象放入 AryyList中 ( 使用泛型 ) 对集合中的元 阅读全文

posted @ 2022-03-19 22:57 我要当程序源 阅读(27) 评论(0) 推荐(0) 编辑

2022年3月18日

集合作业章节下半部

摘要: Map hashMap = new HashMap(); hashMap.put("jack",650); hashMap.put("tom",1200); hashMap.put("smith",2900); //System.out.println(hashMap); //(1)将jack的工资 阅读全文

posted @ 2022-03-18 22:17 我要当程序源 阅读(12) 评论(0) 推荐(0) 编辑

集合作业章节 上半部

摘要: public class HomeWork01 { public static void main(String[] args) { /* (1)封装一个新闻类, 包含标题和内容属性 ,提供get.set方法, 重写toString方法, 打印 对象时只打印标题 (2)只提供一个带参数的构造器, 实 阅读全文

posted @ 2022-03-18 22:16 我要当程序源 阅读(41) 评论(0) 推荐(0) 编辑

2022年3月17日

TreeSet和propertise有点没搞懂的地方

摘要: //1. 当我们使用输惨构造器,创造TreeSet时仍然是无序的//2. 添加元素, 按照字符串大小来排序//3. 使用TreeSet 提供的一个构造器, 可以传入一个比较器(匿名内部类)// 指定排序规则TreeSet treeSet = new TreeSet(new Comparator() 阅读全文

posted @ 2022-03-17 22:27 我要当程序源 阅读(26) 评论(0) 推荐(0) 编辑

3.17java集合终章

摘要: HashMap小结1. Map接口的常用实现类 : HshMap, Hashtable 和Properties2. HashMap 是 Map接口使用频率最高的实现类 是以key-val对的方式存储数据3. key 不能重复 ,但是值可以充分, 允许使用null 键 和null 值 如果添加相同的k 阅读全文

posted @ 2022-03-17 22:22 我要当程序源 阅读(19) 评论(0) 推荐(0) 编辑

上一页 1 ··· 5 6 7 8 9

导航