这个项目的Maven用法: 右键,新建项目,选Others,然后输入Maven,新建Maven项目,那些GroupId,artifactId现在就先随便填.然后完成,在项目的根目录下就会生成一个pom.xml, 一开始进去是OverView方式,点进去下边那排东西选pom.xml, 再插入老师写的那些东西,然后右键项目->Maven->update Project,就自动从网上导jar包进来了,不用再自己导出找jar包,也符合企业规范.避免冲突这些.
Maven很重要,http://blog.csdn.net/albenxie/article/details/69396871 配置教程
Maven很重要,http://blog.csdn.net/albenxie/article/details/69396871 配置教程
2017-09-27
get函数调用很简单.就先创建一个你自己构建的JavaBean对象,比如我这儿是Man wang2 = new Man();
然后在后面直接写wang2.setName("wangxiaoer");就行了. 在 . 后面写setN之后就会有提示了
然后在后面直接写wang2.setName("wangxiaoer");就行了. 在 . 后面写setN之后就会有提示了
2017-09-27
<!-- https://mvnrepository.com/artifact/com.google.code.gson/gson -->
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.8.0</version>
</dependency>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.8.0</version>
</dependency>
2017-09-24
这样就不会错了。
private static void mapJson(){
Map<String,Object> jo=new HashMap<String,Object>();
jo.put("car", null);
jo.put("girl",new String[]{"张柏芝","张靓颖"});
JSONObject js=new JSONObject();
js.putAll(jo);
System.out.println(js);}
private static void mapJson(){
Map<String,Object> jo=new HashMap<String,Object>();
jo.put("car", null);
jo.put("girl",new String[]{"张柏芝","张靓颖"});
JSONObject js=new JSONObject();
js.putAll(jo);
System.out.println(js);}
2017-09-19