Map中的key-value:映射关系;
定义:Map<string,string>map名=new HashMap<string,string>();
方法:实例化类,即可自动定义;
Map方法:增加:Map名.put(key名);
读取:Map名.get(key名);
KeySet()方法:返回Key集合;
Set <string,string>KeySet=Map名.KeySet()
定义:Map<string,string>map名=new HashMap<string,string>();
方法:实例化类,即可自动定义;
Map方法:增加:Map名.put(key名);
读取:Map名.get(key名);
KeySet()方法:返回Key集合;
Set <string,string>KeySet=Map名.KeySet()
2015-12-02
int index = fileName.lastIndexOf('.');
String prefix =fileName.substring(index+1);//不是从该位置到字符串末尾吗?就不用再用它的长度作为endIndex啊
if (index>0 && prefix.equals("java")){};
int index2 =email.lastIndexOf('@');
String prefix =fileName.substring(index+1);//不是从该位置到字符串末尾吗?就不用再用它的长度作为endIndex啊
if (index>0 && prefix.equals("java")){};
int index2 =email.lastIndexOf('@');
2015-12-01
已采纳回答 / sxian_wang
这是对异常的一种包装技巧。更底层产生的异常需要上层的代码来进行处理。一般而言,如果上层的代码catch到一个异常以后,你想对更上层的结构抛出一个更高级异常来说明。你可以直接在catch...
2015-12-01
已采纳回答 / porter1011
我运行了你的代码,没有出现你的问题,不过有个新问题,输入姓名的时候,光标如果不在最下面的空白处,程序无法运行,但也没有报错。<...图片...>
2015-12-01