Java 6 in 21 Days (5th Edition) Day 17: Communicating Across the Internet

The cover of Teach Yourself Java 6 in 21 Days (5th Edition) by Rogers Cadenhead and Laura Lemay

Home Feedback Other Books Previous Day Next Day

Notes and Corrections

  • View the Certification Practice quiz solution
  • Certification answer: Answer (d) is correct. The class is not an application because it lacks the main() method required to run a class in that manner.

    Answer (c) is incorrect. If there was a main() method that created a ReadTemps object, the output would be 70. The call to put(int[]) in the class puts the three integers in the array at the first three positions of the buffer, replacing their original contents, and sets the position after them. The subsequent call to get() returns 70, the integer in the fourth position.

    Answers (a) and (b) are incorrect.

Source Files

Activities

  • Solution 1: WebSaver.java and WebSaver.class.
  • Solution 2: FingerServer.java, FingerServer.class, agore.plan and gwbush.plan. To run this application on a Windows system, open an MS-DOS window and type java FingerServer at a command line. You can test the server using the Finger program you created during Day 17. Open a second MS-DOS window and use one of the following commands:
    • java Finger agore@localhost
    • java Finger gwbush@localhost