Defining terms Java Scavenger Hunt

J.E.D.I

9.6 Exercises

9.6.1 Defining terms

In your own words, define the following terms: 1. Class 2. Object 3. Instantiate 4. Instance Variable 5. Instance Method 6. Class Variables or static member variables 7. Constructor

9.6.2 Java Scavenger Hunt

Pipoy is a newbie in the Java programming language. He just heard that there are already ready-to-use APIs in Java that one could use in their programs, and hes eager to try them out. The problem is, Pipoy does not have a copy of the Java Documentation, and he also doesnt have an internet access, so theres no way for him to view the Java APIs. Your task is to help Pipoy look for the APIs Application Programming Interface. You should state the class where the method belongs, the method declaration and a sample usage of the said method. For example, if Pipoy wants to know the method that converts a String to integer, your answer should be: Class: Integer Method Declaration: public static int parseInt String value Sample Usage: String strValue = 100; int value = Integer.parseInt strValue ; Make sure that the snippet of code you write in your sample usage compiles and outputs the correct answer, so as not to confuse Pipoy. Hint: All methods are in the java.lang package. In cases where you can find more methods that can accomplish the task, give only one. Now lets start the search 1. Look for a method that checks if a certain String ends with a certain suffix. For example, if the given string is Hello, the method should return true the suffix given is lo, and false if the given suffix is alp. 2. Look for the method that determines the character representation for a specific digit in the specified radix. For example, if the input digit is 15, and the radix is 16, the method would return the character F, since F is the hexadecimal representation for the number 15 base 10. 3. Look for the method that terminates the currently running Java Virtual Machine 4. Look for the method that gets the floor of a double value. For example, if I input a 3.13, the method should return the value 3. 5. Look for the method that determines if a certain character is a digit. For example, if I input 3, it returns the value true. Introduction to Programming I 148 J.E.D.I 10 Creating your own Classes

10.1 Objectives