Visitors to VTC.com will be able to view all introductory videos for each training course.
Free Trial Members will gain access to first three chapters for each training course.
Full Access Members have full access to VTC.com�s entire library of video tutorials.
Now to talk about individual types, you need to understand that there are two basic types used in Visual Basic .NET. There is a value type and a reference type, and what we are going to do in this video is look at the value type in particular. Now, this is not going to be a whole lot of information, but what you get here is critical to understand exactly how this works. First of all a value type, when we use a value type we are simply talking about a particular data type that has been constructed in such a way as to be a value type. So there is nothing that you do to cause this, this is just the way it is. And when we use a value type that means the data is actually stored in the variable, and this basically is most of the variable types that we see in Visual Basic except for object and one or two others. So when we store data in a variable, this basically means that that data gets stored right there in that variable. It's a by-value type storage situation. Now the advantage of this is quick access. Any time I need that variable, I just grab my local copy of that variable; also it's minimal overhead - since nothing's having to manage or maintain pointers or locations to this data there is minimal overhead in dealing with it. Now again all the data types and the structures are value types in .NET. Ok, objects are reference types and we are going to talk about those in the next video. Now there are some limitations on value types; now while they do to give us quick access and minimal overhead they do limit us. Number one - we can't do inheritance with value types and we can't override base class functionalities. Because value types all derive from the system.value class. And if you'll start to dig around out there in the SDK, you'll see some methods in that base class. But you can't inherit or override those things. So the main thing you need to take from this that all of our, what some people call primitive types or variables - short integer, long character and so forth - those are value types. And they are stored more or less locally, the data is stored in that variable and there are no references to any locations. And this makes it quick to get at, quick to save, minimal overhead in creating and destroying these things. So they work excellent for variables. They also, since they are not pointers, that means that two variables can't point to the same location. So we can't point say 'x' and 'y' to the same reference point and then change one and have the value of the other one changed too. And obviously that's not what we want with our variables. So in the next video we are going to take a look at references, and hopefully you'll understand a little more about the difference between these things as you contrast them.
| Course: | Microsoft Visual Basic .NET |
| Author: | Mark Long |
| SKU: | 33433 |
| ISBN: | 1932072349 |
| Release Date: | 2003-05-27 |
| Duration: | 6 hrs / 87 lessons |
| Captions: | No |
| Compatibility: |
Vista/XP/2000, OS X, Linux QuickTime 7, Flash 8 |