2
JSON字符串是:设置为POJO时GSON JSON键都有一个破折号
{
"translation": ["some words"],
"basic": {
"us-phonetic": "'flæbɚɡæstɪd",
"phonetic": "'flæbɚɡæstɪd",
"uk-phonetic": "'flæbəga:stid",
"explains": ["v. some words",
"adj. some words"
]
}
}
但Java不能用它"-"
的值。那么如何获得"us-phonetic"
?
谢谢非常 。 – vancake
但仍然无法正常工作。不知道为什么...只是得到一个空值 – vancake
非常奇怪,因为我刚刚测试了上面的代码,它的工作原理。你在哪里得到一个'null'? –