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

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

Answer Posted / amit kumar sharma

//can not applied this because i is value type and obj is
reference type so this will create error
//u can do this
Object obj = 5;
int i = 6;
i = i + Convert.ToInt32(obj);

Is This Answer Correct ?    8 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain the request flow in asp.net mvc framework?

549


Can I uninstall microsoft .net framework?

548


What is the significance of nonactionattribute?

583


What is edm (entity data model)? : Entity framework

546


What is the purpose of a web form?

552






How to return the JSON from action method in ASP.Net MVC?

691


Where is tempdata stored?

547


What is the greatest advantage of using asp.net mvc over asp.net webforms?

557


how to disable the lazy loading framework?

592


What is filters in web api?

510


Describe the roles of clr in .net framework.?

639


What is rxjava used for?

660


Why to use Html.Partial in ASP.Net MVC?

603


what do you mean by navigation property?

594


what is more complex to implement property, methods or event? how can I define criteria to compare the difficulty of implementation between them? for example the number of methods wanted to implements property is 2 methods. how many methods I need it to implements events?

1690