Join Bruce Van Horn for an in-depth discussion in this video Resizing arrays, part of C# Essential Training: 2 Flow Control, Arrays, and Exception Handling.
- [Instructor] In the last video,…I showed you how to create a simple array of strings…in the C# interactive window.…I wanted to show you a different way…of instantiating the array, such that,…you can instantiate the array and go ahead and fill it,…all in one step.…To make sure that I'm starting fresh,…I'm going to go ahead, and with the C# interactive window open,…I'm going to reset the environment.…I'm just going to click the Reset button here at the top.…That effectively flushed out the work that I did earlier,…and now I'm going to clear the screen…by clicking the Clear Screen button.…
So now I have a fresh start.…Let's make our grocery list again.…This time we'll do it in one step.…So I'll say, var groceryList = new string,…just like I did last time,…but this time I'm going to use curly braces,…and I'm going to add, "Milk", "Eggs", "Cheese", and "Apples",…all on one line, so this will instantiate…and fill the array, and it's much shorter.…
I can press Enter, and now I can check the values…of my array by referencing the index.…
AuthorBruce Van Horn
- Writing unit tests in C#
- Working with simple and multidimensional arrays
- Managing ordered and unordered data with lists
- Evaluating conditions with if-else statements
- Using OR, AND, and NOT operators
- Building loops
- Debugging and handling exceptions
- Creating the final build of your C# project
Skill Level Beginner
C# Object-Oriented Programming Tips and Trickswith Jesse Freeman58m 39s Intermediate
1. Unit Testing and Test-Driven Development
2. Arrays and Collections
3. Flow Control
4. Exception Handling
5. Getting to Production
Next steps1m 57s
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.