Chapter 7. Methods: A Deeper Look

 

E pluribus unum. (One composed of many.)

 
 --Virgil
 

O! call back yesterday, bid time return.

 
 --William Shakespeare
 

Call me Ishmael.

 
 --Herman Melville
 

Answer me in one word.

 
 --William Shakespeare
 

There is a point at which methods devour themselves.

 
 --Frantz Fanon

Objectives

In this chapter you’ll learn:

  • How static methods and variables are associated with classes rather than objects.
  • How the method call/return mechanism is supported by the method-call stack.
  • How to use random-number generation to implement game-playing applications.
  • How the visibility of declarations is limited to specific parts of applications.
  • How to create overloaded methods.
  • How to use optional and named parameters.
  • What recursive methods ...

Get Visual C# 2010: How to Program, Fourth Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.