HashMap的JSON表示

时间:2015-05-15 18:34:51

标签: java json hashmap

for (i = 0; i < size; i++) MPI_Irecv(&data[i*100], 100, MPI_INT, i, 0, comm, &requests[i]); /* No touching data in here */ MPI_Waitall(i, requests, statuses); /* You can touch data here */ for (i = 0; i < size; i++) MPI_Isend(&data[i*100], 100, MPI_INT, i+1, 0, comm); /* i+1 is wherever you want to send the data */ /* No touching data in here either */ MPI_Waitall(i, requests, statuses); 的Json表示是什么?

我尝试过这种方式,但收到错误的请求错误。

HashMap<String, String>

3 个答案:

答案 0 :(得分:6)

"userPreferences":{"mobile":"yes","email":"yes"}

答案 1 :(得分:5)

应该是这样的

{ "userPreferences":{"mobile":"yes","email":"yes"} }

答案 2 :(得分:2)

您拥有的JSON即使是JavaScript对象也无效,因为您尚未为两个“内部”对象定义属性名称。 HashMap基本上是一组键值对。您的JSON应该如下所示:

"userPreferences": {
    "mobile": "yes",
    "email": "yes"
}