+ Start a Discussion
Anudeep BAnudeep B 

explanation for below JSON serialize and deserialize code.

I have a json which has serialized --> {"make":"Desing","year":2000}
class name is car
  string s = '{"make":"Desing","year":2000}';

i want deserialized explanation for below i did
car c =(car)JSON.deserialize(s,car.class);

for the above line what is the responsibilities of these each word --> (car), (s, car.class)
Hi Anudeep,

1) (car)
     Converting JSON.deserialize return type to the class car.
2)(s, car.class)
    s : is for jsonString  (The jsonString argument is the JSON content to deserialize.)
    car.class : is for apexType input argument (The apexType argument is the Apex type of the object that this method creates after deserializing                           the JSON content.)
You can find detailed explanation in the below article.