zoukankan      html  css  js  c++  java
  • JSONObject 解析

    前解析json已使用get方法,但是,假设抛出将解决很烦人中断。

    今天发现JSONObject还提供了一个更好用的方法opt。看来以后文档还是要更加认真的读的。以下是文档中的原文。

    A JSONObject constructor can be used to convert an external form JSON text into an internal form whose values can be retrieved with the get and opt methods, or to convert values into a JSON text using the put and toString methods. A get method returns a value if one can be found, and throws an exception if one cannot be found. An opt method returns a default value instead of throwing an exception, and so is useful for obtaining optional values.

    详见:http://www.json.org/javadoc/org/json/JSONObject.html



    版权声明:本文博客原创文章,博客,未经同意,不得转载。

  • 相关阅读:
    4.文本规范化处理
    2.自动文本分类
    3.文本分类的蓝图
    1.什么是文本分类
    2.文本规范化
    Python 处理和理解文本
    1.文本切分
    验证码识别
    随机函数
    Java编程思想笔记(多态)
  • 原文地址:https://www.cnblogs.com/gcczhongduan/p/4644682.html
Copyright © 2011-2022 走看看