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



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

Answer / 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

More ASP.NET Interview Questions

How can we make sure that Web API returns JSON data only?

0 Answers  


Can One website be made using two different languages like c#,vb.net etc......

4 Answers   ABC,


How do you implement postback with a text box?

0 Answers  


difference between gridview,data list and repeater control

7 Answers   ABC, Olive Tech,


What is parse in asp.net?

0 Answers  






what is the trace in ASP.NET

4 Answers  


Explain the differences between Server-side and Client-side code?

2 Answers  


Why do you use the app_code folder in asp.net?

0 Answers  


What is reflection and disadvantages of reflection?

6 Answers   Microsoft,


Suppose there is one web farm with 3 servers inside with same configuration and the same project is running inside all servers.Which session mode is usde for all these and why?

3 Answers  


How .net CLR works with n-tier application

4 Answers   HCL, Hughes,


How would ASP and ASP.NET applications run at the same time on the same server?

0 Answers   Satyam,


Categories