amrebinnaz


{ City } erode
< Country > india
* Profession * software engineer
User No # 75706
Total Questions Posted # 0
Total Answers Posted # 1

Total Answers Posted for My Questions # 0
Total Views for My Questions # 0

Users Marked my Answers as Correct # 1
Users Marked my Answers as Wrong # 0
Questions / { amrebinnaz }
Questions Answers Category Views Company eMail




Answers / { amrebinnaz }

Question { Kanbay, 9432 }

will this code works fine? or will it gives error?

Object obj=5;
int i=6;
i=i+obj;


Answer

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