Registering custom Gson classes

Report a typo

Given the FlyingCar and FlyingCarGsonDeserializer classes, write the missing method call with both arguments needed to register the custom deserializer.

Gson gson = new GsonBuilder()
    // register custom deserializer for FlyingCar class here
    .create();

String jsonInput = ...; // initialized with serialized form of FlyingCar
FlyingCar flyingCar = gson.fromJson(jsonInput, FlyingCar.class);
Enter a short text
___

Create a free account to access the full topic