Self-Review Exercises

6.1Fill in the blanks in each of the following statements:
  1. A method is invoked with a(n)_____.

  2. A variable known only within the method in which it is declared is called a(n)_____.

  3. The_____ statement in a called method can be used to pass the value of an expression back to the calling method.

  4. The keyword _____ indicates that a method does not return a value.

  5. Data can be added or removed only from the _____ of a stack.

  6. Stacks are known as _____ data structures—the last item pushed (inserted) on the stack is the first item popped (removed) from the stack.

  7. The three ways to return control from a called method to a caller are _____,_____ and _____.

  8. An object of class ______ produces random numbers.

  9. The program execution stack contains ...

Get Java™ How to Program, Seventh Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.