4. Methods and Parameters

FROM WHAT YOU HAVE LEARNED about C# programming so far, you should be able to write structured programs that are similar to programs created in the 1970s. Obviously, programming has come a long way since the 1970s, and the next major programming paradigm was structured programming. Structured programming provides a construct into which statements are grouped together to form a unit. Furthermore, with structured programming, it is possible to pass data to a group of statements and then have data returned once the statements have executed.

This chapter covers how to group statements together into a method. In addition, it covers how to call a method, including how to pass data to a method and receive data from a method. ...

Get Essential C# 2.0 now with O’Reilly online learning.

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