关注
package notebook; import java.util.LinkedHashMap; public class notebook { public static void main(String[] args) { LinkedHashMap<Integer,String> notebook=new LinkedHashMap<Integer,String>(); //存储记录 notebook.put(1, "Happy"); notebook.put(2, "New"); notebook.put(3, "Year"); notebook.put(4, "Everyone"); //获取存储记录的数量 int num=notebook.size(); System.out.println("存储记录的数量为:"+num); //查看某一条记录 System.out.println("第1条记录为:"+notebook.get(1)); //列出所有记录 for(int i=0;i<num;i++) { System.out.println(notebook.get(i)); } //删除某一条记录 notebook.remove(2); //列出所有记录 for(int i=0;i<num;i++) { System.out.println(notebook.get(i)); } } }
查看原帖
点赞 评论
相关推荐
投递哔哩哔哩等公司10个岗位
点赞 评论 收藏
分享
牛客热帖
正在热议
# 写简历别走弯路 #
580004次浏览 7192人参与
# 0offer互助地 #
120475次浏览 1230人参与
# 你的简历改到第几版了 #
641660次浏览 9443人参与
# 我的简历长这样 #
1632051次浏览 25633人参与
# 寒假躺平还是提前实习 #
21605次浏览 91人参与
# 你会为了工作牺牲生活吗? #
18085次浏览 161人参与
# 国企vs私企,你更想去? #
77224次浏览 942人参与
# 如何写一份好简历 #
553594次浏览 8040人参与
# 第一份工作应该只看薪资吗 #
45074次浏览 814人参与
# 最后再改一次简历 #
1708755次浏览 27267人参与
# 正在实习的碎碎念 #
1173004次浏览 12438人参与
# 实习与准备秋招该如何平衡 #
600254次浏览 7432人参与
# 工作两年想退休了 #
43405次浏览 551人参与
# 同bg的你秋招战况如何? #
17982次浏览 146人参与
# 你们的毕业论文什么进度了 #
762165次浏览 7655人参与
# 非技术岗薪资爆料 #
135272次浏览 1239人参与
# 蚂蚁求职进展汇总 #
13408次浏览 185人参与
# 工作压力大怎么缓解 #
29676次浏览 444人参与
# offer帮选 #
211037次浏览 2158人参与
# 能让你振作起来的一句话 #
32821次浏览 329人参与