The pages of this web site are not formatted to conserve paper, but my new book (ISBN: 0-9745862-0-X) is formatted to save paper, save your printer cartridge, save a loose-leaf binder, and save money. If you prefer to work my exams from printed pages, then give your printer a rest and buy my new book.
Today, you can find my book at amazon.com.
| No. | Answer | Remark | |
|---|---|---|---|
| 1 | e | Prints: FDDD | The method name abs is overloaded. There are versions that accept one argument of type int, long, float or double. The type of the return value is the same as the argument type. The sqrt method is not overloaded. The parameter type is double and the return type is double. |
| 2 | d | Prints: IIILFD |
There are four overloaded versions of the
|
| 3 | g | Prints: FDIL |
The method name
abs
is overloaded.
There are versions that accept one argument of
type
int,
long,
float
or
double.
The type of the return value is the same as the
argument type.
There are two versions of the
|
| 4 | g | round | |
| 5 | l | None of the above | |
| 6 | l | None of the above | |
| 7 | e | The returned value is of type long only if the argument is of type double. | |
| 8 | c | Adds 0.5 to the argument and takes the floor of the result. | |
| 9 | f | None of the above |
If the
|
| 10 | a | It is not overloaded. | The argument and returned value are both of type double. If the argument is negative, then the returned value is NaN. |
| 11 | a c | It is not overloaded. The argument is an angle measured in radians. | The argument is of type double and represents an angle measured in radians. The returned value is of type double. The method does not throw any exceptions. |
| 12 | e | None of the above | The random method is not overloaded, does not declare any parameters and does not throw any exceptions. The returned value is greater than or equal to zero and is less than but not equal to one. |
| 13 | e | Returns the largest whole number that is less than or equal to the argument value. | The floor method is not overloaded, and declares only one parameter of type double. The return value is always of type double. The floor method does not declare any exceptions. |
| 14 | f | Returns the smallest whole number that is greater than or equal to the argument value. | The ceil method is not overloaded, and declares only one parameter of type double. The return value is always of type double. The ceil method does not declare any exceptions. |
| 15 | a c f | Four overloaded versions of abs exist. The type of the return value depends on the argument type. If the argument is positive, then the argument is returned. |
The method name
abs
is overloaded.
There are versions that accept one argument of
type
int,
long,
float
or
double.
The type of the return value is the same as the
argument type.
No exceptions are declared.
If the argument is a negative integral value, then the returned
value is the two's complement of the argument.
The magnitude of
|
| 16 | b c e f h | Positive infinity NaN Integer.MIN_VALUE Long.MIN_VALUE Positive zero |
The method name
abs
is overloaded.
There are versions that accept one argument of
type
int,
long,
float
or
double.
The type of the return value is the same as the
argument type.
The result is positive infinity if the argument is negative infinity.
The result is positive zero if the argument is negative zero.
The result is NaN if the argument is NaN.
If the argument is a negative integral value, then the returned
value is the two's complement of the argument.
The magnitude of
|
| 17 | c | Prints: -4.0,-3.0,3.0,4.0 |
The
|
| 18 | h | None of the above |
The
|
| 19 | a | Prints: 0,0 |
The
|