Difference b/w casting and boxing?

Answer Posted / linton lazar

Boxing is converting a value type to a reference type
(Object Type).Casting is converting a reference type to a
reference type or a value type as another value type.
int i = 0;
object o = (object)i; //this is boxing
int i2 = (int)o; //this is unboxing.

long l = (long)i; //this is casting.

Is This Answer Correct ?    22 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

witch is the best insistute in sharpoint course.what abt future of share point course.

2730


How much is the pay-for-use service if I chose not to use microsoft-sponsored advertising?

609


What is mvc in asp.net interview question? : Asp.Net MVC

584


Explain the difference between asp.net mvc and asp.net webforms? : asp.net mvc

626


What is runat?

694






Is asp.net still used?

651


Explain the flow of processing of the request? : asp.net mvc

601


Define tracing.

722


Explain how does asp page work?

658


In a Repeater control how one can provide an alternating color scheme ?

656


What are merge modules?

638


What is _viewstart?

585


Which is the parent class of the web server control?

663


Name the method that needs to be invoked on the dataadapter control to fill the generated dataset with data?

622


How many types of cookies are available in asp?

679