![](https://img-blog.csdnimg.cn/20201014180756918.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
java
Simple no1.
这个作者很懒,什么都没留下…
展开
-
HashMap集合创建及遍历(高效率)
HashMap集合遍历方法 //创建集合 Map hashMap=new HashMap<>(); hashMap.put(1,"小贾"); hashMap.put(2,"小王"); //遍历方法 Set<Map.Entry<String,Long>> entries= hashMap.entrySet(); for(Map.Entry<String,Long> entry:entries){ System.out.println(entry.get原创 2021-04-20 14:15:08 · 526 阅读 · 0 评论 -
Get Set方法与构造函数的区别
getset方法的作用 可以访问所在类中的private的属性; public static void main(String[] args) { SetGetConstruct s = new SetGetConstruct("simple", 21); s.getAge(); } 构造方法创建的对象不能访问该类中private的属性; public class Test { public static void main(String[] args原创 2021-04-02 11:09:33 · 474 阅读 · 0 评论