O'Reilly logo

Java™ How to Program, Seventh Edition by P. J. Deitel - Deitel & Associates, Inc., H. M. Deitel - Deitel & Associates, Inc.

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Exercises

2.7Fill in the blanks in each of the following statements:
  1. _____ are used to document a program and improve its readability.

  2. A decision can be made in a Java program with a(n) _____.

  3. Calculations are normally performed by _____ statements.

  4. The arithmetic operators with the same precedence as multiplication are _____ and _____.

  5. When parentheses in an arithmetic expression are nested, the _____ set of parentheses is evaluated first.

  6. A location in the computer’s memory that may contain different values at various times throughout the execution of a program is called a(n) _____.

2.8Write Java statements that accomplish each of the following tasks:
  1. Display the message "Enter an integer: ", leaving the cursor on the same line.

  2. Assign the product ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required