TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
C# Corner
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Boxing and UnBoxing
Karthikeyan Anbarasan
Apr 01, 2011
3
k
0
0
facebook
twitter
linkedIn
Reddit
WhatsApp
Email
Bookmark
In this Blog you will see Boxing and UnBoxing in C#.
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
}
Boxing and UnBoxing
Next Recommended Reading
What Is Object Type, Boxing, And Unboxing In C#