im learning parcing and got a problem trying to make it happen. found a lot of similar questions and more solutions but nothing helped me
thats my json
{
"firstName": "name",
"lastName": "last",
"resistances": {
"a1": 1,
"a2": 2,
"a3": 3,
"a4": 4
}
}
Player.class
class Player implements Serializable{
String firstName;
String lastName;
int[] resistances;
public Player(String firstName, String lastName, int[] resistances) {
this.firstName = firstName;
this.lastName = lastName;
this.resistances = resistances;
}
}
and how i try to parce
Gson gson = new Gson();
Player player = gson.fromJson("test.json", Player.class);
SOS