.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Imran Ghani

Home >> Code Snippets >> Generics >> Post New Resource Bookmark and Share   

 Subscribe to Code Snippets


Posted By:Karthikeyan Anbarasan       Posted Date: January 01, 2011    Points: 15    Category: Generics    URL: http://www.dotnetspark.com  


public virtual int Add(object value);
public virtual object this[int index] {get; set;}

System.Collections.ArrayList list = new System.Collections.ArrayList();

list.Add("a string");
list.Add(45); //no exception thrown
list.Add(new System.Collections.ArrayList()); //no exception

foreach(string s in list) { //exception will be thrown!


Further Readings:


No response found. Be the first to respond this post

Post Comment

You must Sign In To post reply
Find More code samples in C#, ASP.Net, Vb.Net and more Here

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend