what is serialization, can't i do it for methods or varibales in a class
<p>Could some body explain me why we do serialization an what is profit of this ?</p>

<p>can we put serialize word on method or not, like in the following program on complete class the serialization is done can i do it on a method or a variable</p>

<pre><code>Serializable]
public class StudentInfo
{
    //Default Constructor
    public StudentInfo()
    {

    }
    /// &lt;summary&gt;
    /// Create object of student Class
    /// &lt;/summary&gt;
    /// &lt;param name="intRoll"&gt;Int RollNumber&lt;/param&gt;
    /// &lt;param name="strName"&gt;String Name&lt;/param&gt;
    public StudentInfo(int intRoll, string strName)
    {
        this.Roll = intRoll;
        this.Name = strName;
    }

    private int intRoll;
    private string strName;
    public int Roll
    {
        get
        {
            return intRoll;
        }
        set
        {
            intRoll = value;
        }
    }

    public string Name
    {
        get
        {
            return strName;
        }
        set
        {
            strName = value;
        }
    }
}
</code></pre>
