How to Create Lists of Objects in C# - LIST

Опубликовано: 15 Май 2026
на канале: PrograLabs
2,316
87

Your support helps me continue creating more free tutorials 🙌
https://ko-fi.com/progralabs

Turn your classes into dynamic collections with lists in C#. I'll show you how!

In this video, we'll learn how to create and manage lists of objects in C#. Unlike arrays, lists allow you to dynamically add and remove elements. We'll show you how to override the ToString() method to customize the output of our objects and how to add objects to the list more efficiently. Perfect for those looking to manage custom collections in their applications!

What You'll Learn:
• Create and declare lists of custom objects in C# using List
• Add objects to a list individually or anonymously using the Add() method.
• Override the ToString() method to customize how objects are displayed in the console.
• Iterate through lists of objects using a foreach loop to access their properties.
• Differences between lists and arrays and when to use each based on data type and flexibility.

MORE FROM PROGRALABS:
Subscribe:    / @progralabs  
Click the Like button! 👍

CONTENTS
00:00 How to Create a List of Objects
00:39 Instantiating Objects
01:30 Adding Objects to the List with the Add Method
01:57 Traversing the List and Displaying Objects with Foreach
02:19 Problem Printing Objects Directly
02:43 Overriding the ToString Method
03:39 Adding Objects Anonymously in the Add Method
04:18 Comparison between Creating Separate and Anonymous Objects
04:45 Conclusion

#CSharp #Programming #ListsInCSharp #CSharpProgramming #LearnCSharp #SoftwareDevelopment #CSharpLanguage #ProgrammingClasses #CSharpCollections #ProgrammingTips #ObjectsInCSharp #ToStringCSharp #CSharpTutorial