CHAPTER 34A — Parameters, Local Variables, and Overloading

Classic programmed-learning exercises, refreshed for modern Java and presented in the current MrStyner.com portfolio style.

Modern Java noteThis archive has been refreshed for Java 25 LTS. Core language concepts remain useful, while outdated setup instructions and browser-era Java are labeled or replaced. Java 26 is the current feature release; Java 25 is used here as the stable teaching baseline.
go to home page   go to next page

created: 12/30/98; revised: 09/26/99, 01/21/00, 07/14/02, 01/19/06, 04/15/07

CHAPTER 34A — Parameters, Local Variables,
and Overloading

The state of an object consists of the data it holds in its instance variables. Instance variables hold their values until they are explicitly changed or until the object is destroyed.

An object's methods frequently work with other values that are not held in instance variables. These values are held in local variables and parameters. This chapter discusses how these are declared and used.

Chapter Topics:

  • Formal and Actual Parameters
  • Scope of Parameters
  • Local Variables
  • Scope of Local Variables
  • Method Overloading
  • Signature of a Method

QUESTION 1:

(Review:) What is a parameter of a method?