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

What are the components required to create a route in ASP.Net MVC?

581


Mention some action filters which are used regularly in ASP.Net MVC?

542


What is connected scenario? : Entity framework

547


What is Peek method in Tempdata in ASP.Net MVC?

596


What are HTML Helpers, AJAX Helpers in ASP.Net MVC?

570






What is the importance of NonActionAttribute?

605


What are sections?

567


Is entity framework slow?

517


What are the 3 segments of the default route, that is present in an ASP.NET MVC application?

592


Explain dependency resolution?

615


Is it possible to cancel filter execution?

547


In Server how to check whether model has error or not in ASP.Net MVC

617


explain how you can load related entities in ef (entity framework)?

538


What is the difference between model view and controller?

479


how do you query in entity model when the result has a join from from different database other than the entity model?

552