O'Reilly logo

Visual Basic® .NET by Example by Bob Donald, Gabriel Oancea

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Shared Members Definition

To better understand shared members, we will start with an example. Let's assume that you have to code a class that models a product sold in a shop and that the shop is geographically situated in a state or country that has a sales tax. Your product class will have to calculate the price charged for the product, based on the list price of the product, the sales tax, any discounts entered by the sales clerk, and the quantity purchased. You could design and then implement a class like the one shown here:

Public Class Product
   Private m_name As String ' product name
   Private m_listPrice As Decimal ' the list price
   Private m_taxRate As Double Public ReadOnly Property name() As String Get Return m_name End Get End Property ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required