will this code works fine? or will it gives error?

Object obj=5;
int i=6;
i=i+obj;

Answer Posted / naren

object obj=5 this is boxing

int i=6 this is initialization of variable.

i=i+obj; here we can't sum the value type and reference
type.


so,it gives the error.

Is This Answer Correct ?    10 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is entitycontainer? : Entity framework

769


How can we determine action invoked from HTTP GET or HTTP POST?

757


What are ajax helpers in mvc?

704


what is model first approach?

803


What are Action Methods in ASP.NET MVC?

789


What is .net architecture and framework?

769


Why should we go for entity framework?

718


what is explicit loading?

840


why DotNetFramework is included in building a software

2425


What is an asynchronous controller in asp.net mvc?

708


What is viewbag?

781


Is .net framework dead?

718


Explain peek method in tempdata in asp.net mvc?

796


What is the use of web api ? Why web api needed, if you have already restful services using wcf ?

735


Can you please explain the request flow in ASP.NET MVC framework?

832