Self-Review Exercises


Fill 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’s 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            ...

Get Java How to Program (early objects), 9/e now with O’Reilly online learning.

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