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 an asynchronous controller in asp.net mvc?

545


What are scaffold templates in mvc?

580


What are the advantages of asp.net mvc?

561


Explain the types of Scaffoldings.

631


Why is entity framework used?

572






What is .net architecture?

546


How do I install .net framework?

527


What is the purpose of a web form?

552


What is the advantage of using asp.net routing?

595


What is meant by domain model?

543


What is difference between viewbag and viewdata and tempdata?

533


What is the need of Action Filters in ASP.Net MVC

571


Will c# 3.0, vb.net 9.0, atlas, or linq be included in the .net framework 3.0?

525


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

562


What is .net architecture and framework?

577