美文网首页
JSONObject optString与getString的

JSONObject optString与getString的

作者: Karma1026 | 来源:发表于2017-09-29 17:39 被阅读143次

    getString(String name)与optString(String name),功能一样,只是当无返回值时,getString(String name)抛出错误,optString(String name)返回空值

    Returns the value mapped by name if it exists, coercing it if necessary, or throws if no such mapping exists.

    Returns the value mapped by name
    if it exists, coercing it if necessary, or the empty string if no such mapping exists.

    相关文章

      网友评论

          本文标题: JSONObject optString与getString的

          本文链接:https://www.haomeiwen.com/subject/pmziextx.html