0

I realized ObjectMapper's writeValueAsString method takes an Object type as a parameter. But it is able to produce correct JSON from underlying class object(which is a subclass of Object class). Normally, Java compiler wouldn't be able to access fields of a subclass from a superclass. How does ObjectMapper do it?

nmd_07
  • 666
  • 1
  • 9
  • 25

0 Answers0