Skip Top Navigation Bar

Interpreting the API

In this activity, you will explore the API for various classes that we have been working with or will be working with in the future. You should always explore the API for the latest version of Java. Java is updated every 6 months (September and March). Just like with all software, if it important to be on the latest version of Java.

Get started: Find the latest API by searching API Java and the version number in your browser. Use the search bar to find the class you will be investigating.

Grab a Piece of Paper!

String Class

  1. Read the description for the class and summarize what it is used for.
  2. Find the String methods you can use to answer the following situations:
    1. find how many characters are in a word or sentence.
    2. change all letters in a word to uppercase.
    3. find the character at a specific position in a word.
    4. check whether a sentence contains a certain word.
    5. remove extra spaces from the beginning and end of a String.

IO Class

  1. Read the description for the class and summarize what it is used for.
  2. Find the IO methods you can use to answer the following situations, there may be more than one:
    1. write an expression to the console and move to the next line.
    2. read a String in from the console without a prompt.
    3. read a String in from the console after prompting the user for the input.

Math Class

  1. Read the description for the class and summarize what it is used for.
  2. Find the Math methods you can use to answer the following situations, there may be more than one:
    1. find the larger of two numbers.
    2. find the smaller of two numbers.
    3. calculate a number raised to a power.
    4. calculate the square root of a number.
    5. generate a random decimal value.

LocalDate

  1. Read the description for the class and summarize what it is used for.
  2. Find the LocalDate methods you can use to answer the following situations:
    1. get today’s date.
    2. create a date from a year, month, and day.
    3. find the date one week from today.
    4. find the month of a date.
    5. determine whether one date comes before another date.