will this code works fine? or will it gives error? Object
obj=5; int i=6; i=i+obj;

Answer Posted / alb.shah

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 ?    15 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are directives in asp.net? List down all the important directives.

503


Explain how asp.net different from asp?

563


Explain login control and form authentication.

565


Explain the difference between or and orelse?

538


Which protocol is used to call web service?

562






What are cookies in your browser?

535


Explain advantages of caching?

532


Explain what are the advantages of asp.net mvc framework? : asp.net mvc

521


How to Separate background image and front image from original picture....

559


Is web config mandatory?

540


What is session management in web application?

553


Explain the updatepanel?

584


Explain the difference between server control and html control.

476


Are there any resources for drop-in replacements for the default css that comes with the ASP.NET Website template?

563


How can we add an event handler for a ASP.NET function executed on MouseOver for a certain button.

623