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 the 'page life cycle' of an ASP.NET MVC?
what is entityclient?
What is the difference between adding routes, to a webforms application and to an mvc application?
differences between poco, model first and data first approach?
Which .net framework is installed?
how do you query in entity model when the result has a join from from different database other than the entity model?
Will there be a .net compact framework 3.0 release with release of .net framework 3.0?
What is code first? : Entity framework
Which is the default http method for an action method?
How does the 'page lifecycle' of asp.net mvc works?
what is dot net? what is use dot net? what is benifit of dot net?what is vb dot net? what is ado dot net? what is c#?
Explain unit test done by tester on development team?
What is associationset? : Entity framework
What is the .net framework 3.0 (formerly winfx)?
How to answer for project questions..?