关于fileutil读取json文件空指针异常的解决:用json文件的绝对路径。
String content=FileUtils.readFileToString(new File("D:/MyEclipse WorkSpace/JsonRead/src/main/java/wang.json"),"UTF-8");
String content=FileUtils.readFileToString(new File("D:/MyEclipse WorkSpace/JsonRead/src/main/java/wang.json"),"UTF-8");
2018-03-05
{
“name”:"王小二",
“age”:25,
"birthday":"1994-01-01",
"school":"北大蓝翔",
"major":["理发","挖掘机"],
"has_girlfried":false,
"car":null,
"house":null,
"comment":"这是一个注释"
}
“name”:"王小二",
“age”:25,
"birthday":"1994-01-01",
"school":"北大蓝翔",
"major":["理发","挖掘机"],
"has_girlfried":false,
"car":null,
"house":null,
"comment":"这是一个注释"
}
2018-02-02