Java Reference
In-Depth Information
Answers to Review Questions
1.
return.
2.
void.
3.
True, although private methods can be invoked only by other methods in the class.
4.
False. In fact, most methods you write will not be static.
5.
False. A method signature must contain parentheses immediately following the
method name. If there are no parameters, the parentheses will be empty.
6.
findInRange.
7.
double.
8.
Three: two ints and a boolean.
9.
protected.
10.
Hopefully false, even though the method could be written so that it did throw an
exception every time. However, the throws keyword in a method signature means
that the method might throw an exception, not that it will throw an exception.
11.
The this keyword.
12.
True. The generated constructor is referred to as the default constructor.
13.
False. It is your decision whether you want your class to have a no-argument
constructor.
14.
Call-by-value.
15.
False. With call-by-value, methods cannot change arguments, no matter what.
Search WWH ::




Custom Search