Interview Questions

What should one do to make class serializable?

.NET Interview Questions and Answers


(Continued from previous question...)

What should one do to make class serializable?

Answers1:
To make a class serializable is to mark it with the Serializable attribute as follows.
[Serializable]
public class MyObject {
public int n1 = 0;
public int n2 = 0;
public String str = null;
}

(Continued on next question...)

Other Interview Questions