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 ado.net data provider? : Entity framework
How OS come to know whether to load the .net framework when we run an .exe created using .Net framework?
Does .NET Framework support SAX?
What is object service? : Entity framework
Explain RenderBody and RenderPage in ASP.Net MVC?
How does work clr?
differences between poco, model first and data first approach?
what is client wins and store wins mode in entity framework concurrency?
What is the difference between viewbag and viewdata in mvc?
List out few different return types of a controller action method?
i have done enough testing in life but now stated developing intereset in development work,Can i think of entering into development work that too in >Net after more then 4 years of testing experiece?
Can you please explain the request flow in ASP.NET MVC framework?
What is ViewStart Page in ASP.Net MVC?
What is oauth in web api?
What is the difference between windows vista and .net framework 3.0 ?