1 Star 0 Fork 17

xiaohaozi / Flink_Code

forked from Appleyuchi / Flink_Code 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
String_User.java 594 Bytes
一键复制 编辑 原始数据 按行查看 历史
fastsource 提交于 2021-01-20 21:10 . 整理
import com.alibaba.fastjson.JSON;
import java.io.FileNotFoundException;
import java.io.IOException;
public class String_User {
public static void main(String[] args) throws FileNotFoundException, IOException {
//---------------------------json字符串 -> User------------------------
/*
*
* 字符串:{"password":"123456","username":"dmego"}
*/
String jsonStr1 = "{'password':'123456','username':'dmego'}";
User user = JSON.parseObject(jsonStr1, User.class);
System.out.println("json字符串转简单java对象:" + user.toString());
}
}
1
https://gitee.com/haozilovecat/Flink_Code.git
git@gitee.com:haozilovecat/Flink_Code.git
haozilovecat
Flink_Code
Flink_Code
master

搜索帮助