Created
November 12, 2018 07:01
-
-
Save shalithasuranga/caba6ccd22a4dc739054a9b1918a0014 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class PersonDeserialize { | |
public static void main(String[] args) throws Exception{ | |
JsonParser jsonParser = JsonParser.DEFAULT; | |
String json = "{\"name\":\"Jackson\",\"age\":24,\"nickNames\":[\"Jil\",\"Bil\",\"Rock\"],\"city\":\"Colombo\"}"; | |
Person p = jsonParser.parse(json, Person.class); | |
System.out.println(Arrays.toString(p.getNickNames())); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment