© The Author(s), under exclusive license to APress Media, LLC, part of Springer Nature 2022
G. ByrneTarget C#https://doi.org/10.1007/978-1-4842-8619-7_12

12. Methods

Gerard Byrne1  
(1)
Belfast, Ireland
 

Methods: Modularization

We learned in Chapter 11 that arrays are a very important programming structure when we need to “store” a collection of data, variables or objects, of the same data type. We saw that arrays in C# are of a fixed size. Once we declare the size of the array, it cannot be altered. Each item in an array can be referenced using its index, which is also called its subscript, and we can use the foreach loop to iterate the array items. With the foreach iteration, we do not need to use a counter as the foreach construct handles the indexing ...

Get Target C#: Simple Hands-On Programming with Visual Studio 2022 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.