Friday, October 14, 2005

Boxing and Unboxing



int i = 5;

object o = i; // Boxing Value ---> Reference (Implicit)

int j = (int)o; // UnBoxing Reference ---> value (Explicit)

MessageBox.Show(j.ToString());

No comments: