Android Object to JSON Convert toJSON(Object obj)

Here you can find the source of toJSON(Object obj)

Description

to JSON

Declaration

public static String toJSON(Object obj) 

Method Source Code

//package com.java2s;

import com.google.gson.Gson;

public class Main {
    public static String toJSON(Object obj) {
        return new Gson().toJson(obj);
    }/*from  w w  w .jav a 2 s.  c  o m*/
}