Twelfth records of career
来源:互联网 发布:阿里云全球排名 编辑:程序博客网 时间:2024/05/29 19:29
December 7,2016.
Every time i do something quietly ,i don't do it too long,but code to work quietly , so every time you have to force youself to calm down to learn,it is because of this i do not know how long it can persist,or can not let it become a habit ?
The teachers are said to play more code to do more exercise,do this for code played more is the hard truth.is seems to be play some of the code ,and is doomed to have no time to go to sleep.at noon sleep,wake up after the discovery to sleep is a happy thing.
Now say that the hard work, the future can not see hope, then the road so far, how to do?
现在就说辛苦叫累,对未来看不到希望,那以后的路还那么远那该怎么办??
NOTES
package testmap;import java.util.HashMap;
import java.util.Iterator;
import java.util.Map.Entry;
import java.util.Set;
public class TestMap {
public static void main(String[] args) {
HashMap<String, String> hm=new HashMap<String, String>();
//将“abc”存入集合 它 的键是“01”
hm.put("01", "abc");
hm.put("00", "abcd");
//当存有的数据的键已有时 会覆盖对应的之前的值 方法的返回值是被取代的值
System.out.println(hm.put("01", "aaaaaaaaa"));
System.out.println(hm.size());
//删除对应的键的数据 返回值是被删除的键对应的值
System.out.println(hm.remove("01"));
System.out.println(hm.size());
System.out.println(hm);
//通过传入的键获取到他相应的值
System.out.println(hm.get("00"));
//判断集合是否包含某个键
System.out.println("有这个键吗?"+hm.containsKey("001"));
//判断集合是否包含某个值
System.out.println("是否存在abc"+hm.containsValue("abc"));
//
Set<String> keySet=hm.keySet();
for (Iterator iterator = keySet.iterator(); iterator.hasNext();) {
String key = (String) iterator.next();
//通过方法获取到的键 使用get()方法获取对应的值
System.out.println("hm里面的键: "+key+"对应的值为: "+hm.get(key));
}
Set<Entry<String,String>> entrySet=hm.entrySet();
for (Iterator<Entry<String, String>> iterator = entrySet.iterator(); iterator.hasNext();) {
Entry<String, String> entry=iterator.next();
System.out.println(entry.getKey()+"*****"+entry.getValue());
}
}
}
0 0
- Twelfth records of career
- Second records of career
- Third records of career
- Fourth records of career
- Fifth records of career
- Sixth records of career
- Seventh records of career
- Eighth records of career
- Ninth records of career
- Tenth records of career
- Eleventh records of career
- Thirteenth records of career
- Fourteenth records of career
- Twelfth Demo of OGRE
- Four stages of career
- Career
- career
- Records
- 第十五周项目2——用哈希法组织关键字
- 201604-2 试题名称:俄罗斯方块(100分)ccf认证
- java线程中run和start方法的区别
- Java实现(06)——适配器模式(Adapter Pattern)
- Openssl RSA操作
- Twelfth records of career
- linux下的头文件和库文件搜索路径
- 【51Nod】1413 - 权势二进制(思维)
- tower
- DA14580 --- 添加一个自定义服务
- php和uploadify上传文件出现的问题及解决办法
- RHCE-7重置root密码
- android application生命周期介绍
- 【codeforces 246D Colorful Graph 】+ set