From the course: Visual Basic Essential Training

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Quick look at other collection classes

Quick look at other collection classes - Visual Basic Tutorial

From the course: Visual Basic Essential Training

Start my 1-month free trial

Quick look at other collection classes

- [Instructor] We've spent most of this chapter looking at the generic list class. .NET is full of other interesting collection classes that are optimized for other collection scenarios. We'll look at the sorted set and the cube class. I've declared an instance of each at the top of the window class. By declaring it here, they are accessible on all the button handlers. On line six I'm declaring a sorted set that will include doubles. In the first button handler, I fill that sorted set with these number values. And you'll notice they're not in sorted order. On the other button click handler, I generate a random number between one and 10, then I round that to two decimal places and then I add that to the sorted set. So this will allow us to see what happens when new items are added to the set. We'll start with the first five. Now they are arranged in the correct sorted order. We'll add a new item, and I see that that…

Contents