You can tell a lot about a built-in method when you see how it is used. What can you tell about the built-in Pow() method (used to raise a number to a power) from the following statement?double result = Math.Pow(2.0, 3.0);

What will be an ideal response?


From this statement, you know the following about the Pow() method:
1. It is in the Math class because the class name and a dot precede the method call.
2. It is public because you can write a program that uses it.
3. It is static because it is used with its class name and a dot, without any object.
4. It accepts two double parameters.
5. It returns a double or a type that can be promoted automatically to a double (such as an int) because its answer is stored in a double.

Computer Science & Information Technology

You might also like to view...

If a subclass constructor does not explicitly call a superclass constructor, __________.

a. the superclass's fields will be set to the default values for their data types b. Java will automatically call the superclass's default or no-arg constructor immediately after the code in the subclass's constructor executes c. it must include the code necessary to initialize the superclass fields d. Java will automatically call the superclass's default or no-arg constructor just before the code in the subclass's constructor executes

Computer Science & Information Technology

Modify the PhoneBook class to use a TreeMap instead of a HashMap.

What will be an ideal response?

Computer Science & Information Technology

The dynamic design process will break software requirements into smaller modules so that the code will be easier to understand and design.

Answer the following statement true (T) or false (F)

Computer Science & Information Technology

Which of the following is considered to be a common data type??

A. ?Integer B. ?String C. ?Floating-point D. ?All of the above

Computer Science & Information Technology