---
title: "json字符串转json对象"
author: "augustcoco"
date: "2015-03-12T21:56:59Z"
tags: []
categories: ["编程语言"]
slug: "json-json"
draft: false
lastmod: "2015-03-12T21:56:59Z"
id: 2191894
url: "https://augustcoco.iteye.com/blog/2191894"
---

```java

/**
	 * json串解析
	 * @param jsonStr
	 * 			json字符串
	 * @param jsonKey
	 * @return
	 */
	public static String jsonResolve(String jsonStr,String jsonKey){
		Gson gson = new Gson();
		JsonObject respJson = gson.fromJson(jsonStr, JsonObject.class);
		return String.valueOf(respJson.get(jsonKey));
	}

```