function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ 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)
BDatlaBDatla
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.
http://www.salesforce.com/us/developer/docs/dbcom_apex250/Content/apex_methods_system_json.htm

Regards,
BDatla