I am using ObjectMapper class to convert java bean class to json.
Output is comming in {"memberList":[{"id":"4","member":"Saurabh K","dob":"31/12/2012"}]}
format.
I want key id as Id(Mean Capital I)
.
My Bean Class is:-
class MemberClass implements Serializable{ private static final long serialVersionUID = 1L; private Long Id;enter code here private String member; private Date dob; } MemberClass member = new MemberClass(); //some value set in to class variable ObjectMapper mapper = new ObjectMapper(); try {enter code here returnStr += mapper.writeValueAsString(member ); } catch (IOException e) { e.printStackTrace(); }