Tech
News
Videos
Forums
Jobs
Books
Events
More
Interviews
Live
Learn
Training
Career
Members
Blogs
Challenges
Certification
Contribute
Article
Blog
Video
Ebook
Interview Question
Collapse
Feed
Dashboard
Wallet
Learn
Achievements
Network
Rewards
SharpGPT
Premium
Contribute
Article
Blog
Video
Ebook
Interview Question
Register
Login
Generics in C#
WhatsApp
Karthikeyan Anbarasan
13y
3.5
k
0
0
25
Blog
This blog shows on how to use Generics in C#.
public virtual int Add(object value);
public virtual object this[int index] {get; set;}
System.ollections.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!
System.Console.WriteLine(s);
}
Generics in C#
Up Next
Generic vs Non Generic collections
Ebook Download
View all
Mastering SOLID Principles in C#
Read by 2.7k people
Download Now!
Learn
View all
Membership not found