Skip to Main Content
C# 10.0 All-in-One For Dummies
book

C# 10.0 All-in-One For Dummies

by John Paul Mueller
March 2022
Intermediate to advanced content levelIntermediate to advanced
864 pages
19h 46m
English
For Dummies
Content preview from C# 10.0 All-in-One For Dummies

Chapter 6

Lining Up Your Ducks with Collections

IN THIS CHAPTER

Bullet Creating variables that contain multiple items of data: Arrays

Bullet Going arrays one better with flexible collections

Bullet Looking at array and collection initializers and set-type collections

Simple one-value variables of the sort you may encounter in this book fall a bit short in dealing with lots of items of the same kind: ten ducks instead of just one, for example. C# fills the gap with two kinds of variables that store multiple items, generally called collections. The two species of collection are the array and the more general-purpose collection class.

Remember This book specifically uses the term array when discussing arrays. When working with the collection class, the book uses the term collection class. If the book refers to a collection or a list, the object in question can be either an array or a collection class.

An array is a data type that holds a list of objects of the same type. You can’t create a single array that contains both int and double objects, for example. Every object must be of the same type.

C# gives you quite ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

C# Cookbook

C# Cookbook

Joe Mayo
Head First C#, 4th Edition

Head First C#, 4th Edition

Andrew Stellman, Jennifer Greene

Publisher Resources

ISBN: 9781119839071Purchase Link