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

what is value type to reference type

6 Answers   AG Technologies, IBM,


Explain how to prepare culture-specific formatting in .net.

1 Answers  


What are httphandlers and httpmodules and difference between them?

1 Answers  


When would you set this property to false?

2 Answers  


Name the namespace which is used by ado.net?

1 Answers  


can we pass coditions in swtich case?

3 Answers  


What you mean by partial Class in asp.net 2.0?

3 Answers   TCS,


Can we use multiple forms in single asp.net application?

3 Answers   Polaris,


How To Generate ConnectionString By Using Notepad??

2 Answers  


WHT IS DIFFERENCES BETWEEN HTML CONTROLS AND SERVER CONTROLS.

11 Answers   HCL, Microsoft,


What is a 404 redirect?

1 Answers  


Describe the difference between inline and code behind - which is best in a?

1 Answers  


Categories