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 is entityset? : Entity framework

755


What is html.renderpartial?

760


will there be any issues adding a table without primary keys to a data model?

821


What operating systems will the .net framework 3.0 be available for?

782


Is .net core faster than .net framework?

753


What are Validation Annotations?

772


What are the major improvements provided by the common language runtime and the base class libraries? Or what are the major improvements in .net framework 4.0?

730


What are the advantages of mvc over asp.net?

754


what is ssdl?

888


Explain how to use multiple submit buttons in ASP.Net MVC?

843


What you mean by routing in asp.net mvc?

737


What is the difference between renderaction and renderpartial?

841


what is client wins and store wins mode in entity framework concurrency?

917


What is clr? How does work clr & wht is work of clr?

781


What is the full form of sp?

695