CS100M Spring 2007
Project 6 Part A
Due Thursday, May 3 at 6 pm


Java API

Read about the Java API in Section 2.2 (page 36) of the Gaddis text. Next, go to the documentation of the Java API at http://java.sun.com/j2se/1.5.0/docs/api/ to find the answers to the questions below. You do not need to read the API documentation in detail to answer these questions. The objective of this exercise is for you to learn about the API and to learn how to find detailed specifications should you have the need in the future. To answer most of these questions, you only need to skim through the first pages of the description or tables for each class. Save your answers in a plain text file api.txt and submit it to CMS.

  1. What does API stand for? Briefly explain what the Java API is.
  2. Take a look at the Math class. How many abs methods (absolute value) are there? What are the two fields in the Math class?
  3. Take a look at the System class. Which method do you use to get the current system time?
  4. Take a look at the Double class. What does the field MIN_VALUE store?
  5. Take a look at the String class. What does method trim do?
  6. Take a look at the DecimalFormat class. How do the pattern characters 0 and # differ?