X hits on this document

PDF document

“Beginning Visual C# 2005 Express Edition Video Series” - page 26 / 73

240 views

0 shares

0 downloads

0 comments

26 / 73

Methods (for those learning Visual Basic)

The last thing we'll talk about in this lesson is Methods, which is an object oriented way to refer to procedures (or functions). These terms are synonymous, but you'll sound cooler if you say Methods from now on rather than procedures or functions. There are still two different types of procedures -- I mean -- methods: there are Sub Procedures and Functions.

Visual Basic:

Public Function Drive() as string

if m_make = "Oldsmobile" then

return "Chicago" else

return "Toledo" end if

End Function

Methods can be either Private or Public scope. Many times, you'll want Private methods to be used as helper functions or utilities that hide how the class does its work. Ideally, classes are like mysterious "black boxes" to the code that calls them. You know nothing about how the object works except for the Public properties and methods, and that is good. This is known as "Encapsulation" in Object Oriented programming terminology.

Supplemental Readings for the Express Edition Videos Copyright © 2005 LearnVisualStudio.NET



Document info
Document views240
Page views240
Page last viewedFri Jan 20 02:57:57 UTC 2017
Pages73
Paragraphs821
Words15988

Comments