User-Defined Methods

From CompSciWiki
Revision as of 15:32, 20 March 2007 by Umhawwv (Talk | contribs)

Jump to: navigation, search


Wiki 1010 Table of Contents

Chapter #

Up until now, all of the code you have written has been placed in the main method. As programs get larger, code written entirely in the main method becomes unmaintainable and unreadable. This chapter will explain how to define separate code sections which perform specific tasks. These code sections may then be used any number of times. These separate code sections are called user-defined methods.

  Write a Program a Day Case Studies





Table of Contents


Overview

Writing a Method

Calling a User-Defined Method

Methods and Scoping

Commenting Methods

Passing Arguments using Methods

Review Questions and Exercises