Another Example

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.
go to previous page   go to home page   hear noise   go to next page

Answer:

>      // greater-than

Another Example

Here is another program fragment:

int count  = 10;
int inc    = -1;
while ( count  < 100 )   // check the relational operator
{
  System.out.println( "count is:" + count );
  count = ;
}
System.out.println( "count was " + count + " when it failed the test");

How should the assignment statement be completed so that the loop terminates? Type your answer into the blank. Be sure to use the variable inc in your answer.

QUESTION 10:

Fill in the blank.