CHAPTER 28 — Parameters in Method Calls

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

revised: 10/09/98, 09/04/99, 01/20/00, 01/18/06

CHAPTER 28 — Parameters in Method Calls

Often when you use a method, you supply it with some information in the form of parameters. This chapter discusses method calls and parameters.

Chapter Topics:

  • Methods with no parameters
  • Parameter lists
  • Data types of parameters
  • Expressions in parameter lists
  • Conversion of values in parameter lists to required types

QUESTION 1:

After the following statements have executed,

String str = new String("alphabet soup");
int    len = str.length();

what value is in the variable len?