Fill in the Blanks

Classic programmed-learning exercises, refreshed for modern Java and presented in the current MrStyner.com portfolio style.

Modern Java noteThis archive has been refreshed for Java 25 LTS. Core language concepts remain useful, while outdated setup instructions and browser-era Java are labeled or replaced. Java 26 is the current feature release; Java 25 is used here as the stable teaching baseline.

creation: 12/11/99


Fill in the Blanks

Instructions:   This is an ungraded fill-in-the-blank exercise. Each question consists of a sentence with one or two words left out. A button represents the missing word(s). For each question, think of the word or phrase that should fill each blank, then click on the buttons to see if you are correct. No grade is calculated for this exercise.


1. Select a True or False for each set of radio buttons, then click on the "?" button to see what the AND of the two boolean values is.
True
False
  AND   True
False
    equals    

Select a True or False for each set of radio buttons, then click on the "?" button to see what the OR of the two boolean values is.
True
False
  OR   True
False
    equals    

Select a True or False value, then click on the "?" button to see what the NOT of the boolean value is.
  NOT   True
False
    equals    


2.  In Java, the short-circuit AND operator is

The non-short-circuit AND operator is

The short-circuit OR operator is

The non-short-circuit OR operator is

The NOT operator is


3.  Examine the following sets of operators:
  • (unary)-  !
  • *   /
  • +  -
  • <   <=  >  >= 
  • ==  !=
  • &&   ||
Which operators have the HIGHEST precedence?

Which operators have the LOWEST precedence? .

In the following expression, which operator is done first: 4+7*3 < 12 .


4.   1+5/2 > 5-2 && 12 < 23     evaluates to   .

5.   1+2 > 4-2 || Math.sin(1.5) >= Math.cos(0.34)     evaluates to   .

6.   1+1 > 4-2 && 12 < 23 && 'a' == 'a'     evaluates to   .

7.   1 > 4-2 || 23 > 13 && 8 < 10     evaluates to   .

8.   (9 <= 34 || 5 > 25 ) && 7 < 20     evaluates to   .

9.   9 <= 34 || 5 > 25 && 7 < 20     evaluates to   .

10.   9 <= 34 && 5 > 25 || 7 < 20     evaluates to   .


End of the Exercise. If you want to do it again, click on "Refresh" in your browser window.


Click here to go back to the main menu.