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
explain why t4 entity is important in entity framework?
Is .net framework dead?
Does .NET Framework support SAX?
What is MVVM design pattern?
What is entitytype? : Entity framework
What is routeconfig.cs in mvc 4?
What are scaffold templates in mvc?
How to use multiple submit buttons in asp.net mvc?
Which version of .net framework is installed?
What is ado.net data provider? : Entity framework
What is mvc entity framework?
Is the following route definition a valid route definition? {controller}{action}/{id}
What is the version number for the next version of the .net framework, codenamed �orcas�?
What are the possible razor view extensions?
What is iobjectset? : Entity framework