摘要: 直接引入实例进行分析。 通过索引查询数组值 public class DemoArrayException { public static void main(String[] args) { int[] array = {0, 1, 2, 3}; int element = DemoArrayEx 阅读全文
posted @ 2020-01-16 22:15 LeeHua 阅读(559) 评论(0) 推荐(0) 编辑
摘要: 步骤分析 给出一串字符串,字符串中可以包含字母、数字、符号等等。 创建一个Map集合,key是字符串中的字符,value是字符的个数。 遍历字符串,获取每一个字符。 使用获取到的字符,去集合Map判断key(字符)是否存在。 假如key(字符)存在,那么该key对应的value数值增加1,即该字符的 阅读全文
posted @ 2020-01-16 20:25 LeeHua 阅读(3057) 评论(0) 推荐(2) 编辑
摘要: Map集合概述 首先对比一下Map接口和Collection接口 // Collection集合,有一个泛型<E> public interface Collection<E> extends Iterable<E> { ... } // Map集合,有两个泛型<K, V> public inter 阅读全文
posted @ 2020-01-16 19:00 LeeHua 阅读(3002) 评论(0) 推荐(0) 编辑