Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

what is lazy loading in entity framework?

1149


what is .edmx file and what it contains?

1105


Name a few different return types of a controller action method?

1197


How do you assign a value to a complex number 7 how has exception hand changed in .net framework 4.0?

986


What are Code Blocks in Views?

1170


How to change the action name in mvc?

1048


What are Model Binders in ASP.Net MVC?

1372


what is entity graph in entity framework?

1194


Explain how you can send the result back in JSON format in MVC?

1035


What are the advantages of razor view engine?

966


Explain Keep method in Tempdata in ASP.Net MVC?

1129


What operating systems will the .net framework 3.0 be available for?

1081


How does the .net framework 3.0 relate to windows vista?

1074


Is .net framework backwards compatible?

1132


How would you deploy your old applications with .net framework 4.0? Are the old applications compatible?

953