14.6.

It does not compile because the static method 'main' references the =
non-static method 'test4'.



14.9.

false

true



14.10.

Success!

true

false



Method 'search2' is more reusable because it returns a value which can =
direct the program flow in the method that called it. 'search1' simply =
prints a message to the screen and does not indicate to its "parent" =
method whether the target was found.



14.12.

// Generate random bit:

public static int myRand() {

  return (int) (Math.random() * 2);

}



// Generate random character:

public static char myRand(char low, char high) {

  if (low > high) {

    System.out.println("myRand Failure!");

    System.exit(0);

  }

  return (char) ((Math.random() * (high - low + 1)) + ((int) low));

}





14.15.

public static int sum(int x) {

  if (x < 1) return 0;

  return sum(x-1) + x;

}