package com.zkn.newlearn.json; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONObject; import java.util.Map; /** * JSON字符串自动转换 * Created by zkn on 2016/8/22. */ public class JsonToMapTest01 { public static void main(String[] args){…
1.需要用到的包 2.实例 实体类 people package com.shore.entity; /** * @author DSHORE/2019-4-19 * */ public class People { private int pid; private String pname; private int age; private String job; private double sal; public People() { } public People(int pid, St…
java.lang.String和java.util.Date之间自动转换 @DateTimeFormat(pattern="yyyy-MM-dd")//页面写入数据库时格式化 @JSONField(format="yyyy-MM-dd")//数据库导出页面时json格式化 public class User implements Serializable{ private Integer id; private String loginname; private…
一.数据类型自动转换 public class Test{ public static void main(String[] args){ int a = 1; double b = 1.5; double a_b_count = a+b; //整型与双精度型相加时,结果会自动转换为双精度型 String c = "凌"; char d = '晨'; char e = '好'; String c_d_e_content = c+d+e; //字符型与字符串型相加时,结果会自动转换为字符…