Skip to Content
A Programmer's Introduction to Visual Basic® .NET
book

A Programmer's Introduction to Visual Basic® .NET

by Craig Utley
December 2001
Intermediate to advanced content levelIntermediate to advanced
360 pages
9h 6m
English
Sams
Content preview from A Programmer's Introduction to Visual Basic® .NET

Shared Members

VB .NET introduces the concept of shared members. Shared members are a way of creating a member (a property, procedure, or field) that is shared among all instances of a class. For example, you could create a property for a database connection string. This will be the same for each class, so you can fill it in for one class and all classes can then see that one property. Shared properties are most often used in inheritance, so that all objects created from derived classes can share the same member across all instances of the class. However, shared members also can be used regardless of whether you are using inheritance.

To see how shared properties work, suppose that you wanted to create a logging mechanism to record any kind of ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Visual Basic® Programmer's Guide to the .NET Framework Class Library

Visual Basic® Programmer's Guide to the .NET Framework Class Library

Lars Powers, Mike Snell
Application Development Using Visual Basic® and .NET

Application Development Using Visual Basic® and .NET

Robert J. Oberg, Peter Thorsteinson, Dana L. Wyatt
Visual Basic® .NET by Example

Visual Basic® .NET by Example

Gabriel Oancea, Bob Donald

Publisher Resources

ISBN: 0672322641Purchase book