This is my input
String str ="{\n" +
" \"myKey\": [{\n" +
" \"myHhome\": \"home1\",\n" +
" \"myAddress\": \"add\",\n" +
" \"dateTimeStamp\": \"Wed, 20 Mar 2019 14:38:54 GMT\"\n" +
" }\n" +
" ],\n" +
" \"basedata\": {\n" +
" \"mydata\": {\n" +
" \"mytype\": \"m1\",\n" +
" \"mytype2\": \"m2\"\n" +
" }\n" +
" }\n" +
"}\n";
I chekced the json and it is valid I want to use GSON to get the value of the myHhome ( in my case hom1)
static class Myclass{
public String generation = null;
}
final Gson GSON1 = new Gson();
String result= GSON1.fromJson(str,Myclass.class);
System.out.println(result);
but i got null