Skip to main content
  • 169 Accesses

Abstract

Properties have been part of Visual Basic for a long time. In this chapter, we describe how Visual Basic .NET extends the support for properties found in earlier versions of the language. Well see plenty of examples along the way, to illustrate how properties can improve the encapsulation, usability, and robustness of our classes. In this chapter we will cover:

  • The implementation of properties in VB.NET

  • Scalar properties, and their advantages over fields and methods

  • How properties look when compiled to MSIL

  • Read-only and write-only properties, and when to use them

  • Shared properties and when to use them

  • Indexed properties, including default properties and overloading

So, let’s start by defining how properties are implemented in Visual Basic .NET.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 29.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 39.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

Authors

Rights and permissions

Reprints and permissions

Copyright information

© 2003 Damon Allison, Andy Olson, and James Speer

About this chapter

Cite this chapter

Allison, D., Olsen, A., Speer, J. (2003). Properties. In: Visual Basic .NET Class Design Handbook: Coding Effective Classes. Apress, Berkeley, CA. https://doi.org/10.1007/978-1-4302-0780-1_6

Download citation

  • DOI: https://doi.org/10.1007/978-1-4302-0780-1_6

  • Publisher Name: Apress, Berkeley, CA

  • Print ISBN: 978-1-59059-275-5

  • Online ISBN: 978-1-4302-0780-1

  • eBook Packages: Springer Book Archive

Publish with us

Policies and ethics