Skip to navigation
Convert a simple java dict object to a JSON string object
29.04.22
import com.google.gson.Gson; import com.google.gson.GsonBuilder; import java.util.Hashtable; import java.util.Dictionary; Dictionary df = new Hashtable(); df.put("foo", "bar"); Gson gson = new GsonBuilder().setPrettyPrinting().create(); String json = gson.toJson(df); //logme(json, msg); //System.out.println(jsonString);
https://www.tutorialspoint.com/gson/gson_quick_guide.htm
Reply
Anonymous
Information Epoch 1745649816
Files are bags of bytes.
Home
Notebook
Contact us