I was asked the following question in interview:
- Explain XML Serialization.
I have no idea what XML Serialization is. I looked at some sites, but I couldn’t find any (short & clear) explanation about XML Serialization.
Could someone explain what XML Serialization is? It would help so I can have a clear picture on XML Serialization and be ready to face future interviews with confidence whenever this question is asked..
Lets say you have a class like this:
and an object of this class like this:
Then when you xml serialize the object Student. You will get as an output an XML file with the following:
You can deserialize the XML to get the original object as an output.
So it is kind of a conversion between classes and XML
BTW XML files are usualy text files