Java上位机开发(json处理)
source link: https://blog.csdn.net/feixiaoxing/article/details/125713969
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
【 声明:版权所有,欢迎转载,请勿用于商业用途。 联系信箱:feixiaoxing @163.com】
json格式的数据,不仅是用作配置文件的读取,还是用作数据的传递,都是非常方便和简洁的。Java下面有一个json-simple的库,使用上面也是很简单的。
1、下载json-simple库
http://www.java2s.com/Code/Jar/j/Downloadjsonsimple111jar.htm
2、解压提取json-simple-1.1.1.jar.zip
解压后,拷贝到上层目录
3、准备测试代码
代码来自链接地址https://www.w3cschool.cn/json/97631mvx.html,在此表示感谢。
4、编译代码
javac -cp .;json-simple-1.1.1.jar process.java
5、运行代码
java -cp .;json-simple-1.1.1.jar process
没有特殊原因,你会看到这样的内容
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK