Self-Review Exercises

6.1 Fill in the blanks in each of the following statements:

a) A method is invoked with a(n) ________ .

b) A variable known only within the method in which it’s declared is called a(n) ________ .

c) The ________ statement in a called method can be used to pass the value of an expression back to the calling method.

d) The keyword ________ indicates that a method does not return a value.

e) Data can be added or removed only from the ________ of a stack.

f) Stacks are known as ________ data structures; the last item pushed (inserted) onto the stack is the first item popped (removed) from the stack.

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

h) An object of class ...

Get Java™ How To Program (Early Objects), Tenth 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.