will this code works fine? or will it gives error?
Object obj=5;
int i=6;
i=i+obj;
Answer Posted / amre binnaz
Private Sub Button1_Click(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles Button1.Click
Dim obj As Object
Dim i As Int16
obj = 5
i = 6
i = i + obj
MsgBox(i)
End Sub
its working fine the result shows 11
private void button1_Click(object sender, EventArgs e)
{
object obj;
obj = 5;
int i;
i =6;
i = i + Convert.ToInt16(obj);
MessageBox.Show(i.ToString());
}
when you convert the object to int then only working fine
and show result 11
| Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
what is lazy loading in entity framework?
what is .edmx file and what it contains?
Name a few different return types of a controller action method?
How do you assign a value to a complex number 7 how has exception hand changed in .net framework 4.0?
What are Code Blocks in Views?
How to change the action name in mvc?
What are Model Binders in ASP.Net MVC?
what is entity graph in entity framework?
Explain how you can send the result back in JSON format in MVC?
What are the advantages of razor view engine?
Explain Keep method in Tempdata in ASP.Net MVC?
What operating systems will the .net framework 3.0 be available for?
How does the .net framework 3.0 relate to windows vista?
Is .net framework backwards compatible?
How would you deploy your old applications with .net framework 4.0? Are the old applications compatible?