Section 7.21. Wrap-Up


7.21. Wrap-Up

In this chapter, you studied methods in greater depth. We distinguished between subroutines and functions, and when to use each type of method. You saw the difference between non-Shared and Shared methods and how to call Shared methods by preceding the method name with the name of the class in which it appears and a dot (.). We declared named constants using both enumerations and constant variables. You saw that arguments can be implicitly converted to the type of their corresponding parameters. We demonstrated using Option Strict, which causes the compiler to check all conversions and requires you to perform explicit conversion for all narrowing conversions that could cause data loss or program termination. We discussed how Visual Basic performs method calls using a stack data structure. You used class Random to generate random numbers that can be used for simulations and game playing. You studied the scope of instance variables and local variables in classes and methods, respectively. You enhanced your GUI skills, using PictureBoxes, GroupBoxes, Buttons and TextBoxes, and created event handlers for Buttons. Finally, you learned that multiple methods in one class can be overloaded by providing methods with the same name and different signatures. Such methods can be used to perform the same or similar tasks using different types or different numbers of parameters.

In Chapter 8, we discuss how to maintain lists and tables of data in arrays. You will see a more elegant implementation of the application that rolls a die several times and two enhanced versions of the GradeBook case study in Chapters 47.



Visual BasicR 2005 for Programmers. DeitelR Developer Series
Visual Basic 2005 for Programmers (2nd Edition)
ISBN: 013225140X
EAN: 2147483647
Year: 2004
Pages: 435

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net