Navigation

Related Articles

Back to Latest Articles

C# Basics – Object Arrays – Part 13

We get to know how to use object arrays in C# programming language. We can create custom data type or object and use it in an array.


Andraz Krzisnik
C# Basics – Object Arrays – Part...

Object Arrays

We already mentioned before, that when we create a class we create an object with custom data type.

So, as you can see, like strings, integers and other data types, we can create arrays of these custom data types as well.

For example:

For the sake of simplicity, we won’t add any constructors.

Now let’s say we have 200 of these objects and what we want is to process every single one the same way. We do that by creating an array, that can store such data type.


Here we have an example of how object arrays might be used.

Download Examples Next Chapter
Show Comments (0)

Comments

Related Articles

C# Tutorial

C# Tutorial: How To Create Image Zero Padding

Zero padding an image is useful when we’re convolving it with a filter of certain size. How much padding should we use depends on how big our filter is. What is the purpose...

Posted on by Andraz Krzisnik
C# Basics

C# Basics – Random Numbers, Chars and Strings – Part 7

Random Numbers To generate a random number, we will use a constructor called Random. Then to generate a random number we will use either .Next() or .NextDouble() function. Random...

Posted on by Andraz Krzisnik