Link to home
Start Free TrialLog in
Avatar of Ahmed Merghani
Ahmed MerghaniFlag for Sudan

asked on

Converting object properties/values to string or json

Hi expert,

I want to convert class properties and values to string or json. For example:
class A{
  int id;
  String name;
  public A(){
    this.id = 10;
    this.name = "somebody";
  }
}

Open in new window

The expected json string output is like:
{"id":10,"name":"somebody"}
or
id=10,name="somebody"
ASKER CERTIFIED SOLUTION
Avatar of CEHJ
CEHJ
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
:)