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

How the ‘page lifecycle’ of ASP.Net MVC does works?

586


Do you know about the new features in asp.net mvc 4 (asp.net mvc4)?

570


What symbol would you use to denote, the start of a code block in razor views?

561


what is entityclient?

677


Explain how you can send the result back in JSON format in MVC?

574






What are the 2 popular asp.net mvc view engines?

513


what do you mean by table-per-hierarchy?

597


what is split entity?

599


what is code first approach?

580


What are the components of the .net framework.

571


What is meant by viewdata?

548


What is net framework 3.0 ?

590


What are actions in mvc?

549


Can you explain the page life cycle of mvc?

553


What is the difference between renderaction and renderpartial?

610