Self-Review Exercises

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

a) A(n) ________ begins the body of every method, and a(n) ________ ends the body of every method.

b) You can use the ________ statement to make decisions.

c) ________ begins an end-of-line comment.

d) ________ , ________ and ________ are called white space.

e) ________ are reserved for use by Java.

f) Java applications begin execution at method _______.

g) Methods ________ , ________ and ________ display information in a command window.

2.2 State whether each of the following is true or false. If false, explain why.

a) Comments cause the computer to print the text after the // on the screen when the program executes.

b) All variables must be given a type when ...

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.