Boxing and UnBoxing

This blog shows on how to use Boxing and UnBoxing

public static void Main() {
Point p;
p.x = p.y = 1;
Object o = p; // Boxes p; o refers to the boxed instance
p = (Point) o; // Unboxes o AND copies fields from boxed
// instance to stack variable
}
Ebook Download
View all
Learn
View all