By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,089 Members | 2,191 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,089 IT Pros & Developers. It's quick & easy.

Explain with example.Why do we need boxing and unboxing in C#?

P: 22
Why do we need boxing and unboxing in C#?explain with example?

I know what is boxing and unboxing , but I can't understend the real use of it. Why and where should I use it?

Expand|Select|Wrap|Line Numbers
  1. int n = 24;
  2. object ob = n;//boxing
  3.  
  4. int m = (int) ob;//unboxing
Apr 16 '19 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.