As you create an empty map, if you attempt to read "createdDate"
you will get null
as a result. This won’t throw any exception.
However, in the next line you want to initialize a new Date
object and pass dob1
(which is still always null
). This will cause an IllegalArgumentException
to be thrown.
You could easily find all that out yourself by simply executing your code.
solved Can I parse my JSON data like this?