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 eager loading?
What is objectset? : Entity framework
What are actions in mvc?
How to update one of my table in database at 4pm every day how it is possible?
Explain the advantages of asp.net mvc over asp.net?
Explain the methods used to render the views in ASP.Net MVC?
My organization went through the approval process of supporting the .net framework 2.0 in production. Do we need to go through the same process all over again for the .net framework 3.0? Do I need to do any application compatibility testing for my .net framework 2.0 applications?
Is it possible to unit test an mvc application without running the controllers in an asp.net process?
Explain what languages does the .net framework support?
Is it possible to share a view across multiple controllers?
What is the difference between adding routes, to a webforms application and to an mvc application?
What is Separation of Concerns in ASP.NET ASP.Net MVC?
What is the advantage of using asp.net routing?
What are the benefits of .net framework?
Why to use “{resource}.axd/{*pathinfo}” in routing in mvc?