Gson brief notes
•
Java
Introduction to gson:
Gson is a Java class library provided by Google to map between Java objects and JSON data. You can turn a JSON string into a Java object, or vice versa.
Two common methods:
Gson. Tojson (object SRC) -- JSON serialize objects
Gson. From JSON (string JSON, class < T >) -- deserialize JSON strings into objects
Entity class:
Test class:
Operation effect:
The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
二维码