Part 74 List collection class in c#


c# list foreach example
c# list for loop
c# list benefits
c# list advantages
c# access list element
c# list add item
c# list get all elements
c# list insert item at index
c# list insert at beginning
c# list get element at position
c# list insert method
c# list class example
c# list indexof method
c# get list item index

Difference between generic and non generic collections

Link for code samples used in the demo

Link for csharp,,, dotnet basics, mvc and sql server video tutorial playlists

List is one of the generic collection classes present in System.Collections.Generic namespcae. There are several generic collection classes in System.Collections.Generic namespace as listed below.
1. Dictionary – Discussed in Parts 72 & 73
2. List
3. Stack
4. Queue etc

A List class can be used to create a collection of any type. For example, we can create a list of Integers, Strings and even complex types. The objects stored in the list can be accessed by index. Unlike arrays, lists can grow in size automatically. This class also provides methods to search, sort, and manipulate lists.


Xem thêm bài viết khác:


  1. how would i change a list entry?

    intuition says insert and then remove the next list entry after the new one.

    but surely there is a better way of doing this with a built in tool. like mylist.replace[entry](new entry) or something?

  2. Very clear and understandable. Six years from when you made this video, it is still helping people like me!

  3. I (as a non-english native speaker) usually have trouble concentrating on videos with an Indian accent (-sorry for that sad assesment). But this dude is very didactic, expressive and illustrates every point very well! Hugely Recommend his different videos on different reference points for beginners or quick access to specific info!

  4. sir please can you make me clear that whats the diff btw Customer customer1=new Customer(){}; statement and Customer customer1=new Customer(); waiting for your response .. 🙂

  5. What would be the point of setting the length of a list if a list can change so freely?  Thanks for the great videos!

  6. I usually can't stand the Indian accent in tutorials, it's the cadency of the words it distracts me because when you speak with an Indian accent in English the sound is usually flat and has stops after each word. Maybe I'm a dickhead but I'm specifically referring to the combination of flat English + Indian accent in tutorials. The reason why I'm making this statment is to let you know that this does not happen in this video! This tutor is fantastic, dispite having an Indian accent the narration is not flat and it's pleasent, the contents are on point, concise and clear, thank you so much! Subscribed!

  7. In this video you have manually created 3 class instances. Could you tell me how I could dynamically create class instances based on generated lists?

    My question is explained in more detail here:

  8. Thank you very much for this video. It is very helpful.
    Just one thing! it's "Customer" and not "Cusotmr" 😉

  9. Your videos are really good and the way you teach is awesome. I learnt a lot from your videos. Thanks 🙂


Please enter your comment!
Please enter your name here