--

Hi Nilesh

In such cases, we need to use reflection (Java) to create the object. So, we can't use the constructor or builder directly.

To solve this, we introduce a public static method that takes JSON as an input and then returns the constructed object after deserialization. I'll cover this in detail in my next article.

--

--

Animesh Gaitonde
Animesh Gaitonde

Written by Animesh Gaitonde

SDE-3/Tech Lead @ Amazon| ex-Airbnb | ex-Microsoft. Writes about Distributed Systems, Programming Languages & Tech Interviews

No responses yet