Java Reference
In-Depth Information
Review Questions
1.
A method uses what keyword to return a value within the body of the method?
2.
A method uses what keyword to denote that it does not return a value?
3.
True or False: A method can have private access.
4.
True or False: All methods must be declared static.
5.
True or False: The parentheses are optional in a method signature.
Use the following method signature to answer the next five questions:
protected double findInRange(int x, int y, boolean b)
throws NotFoundException
6.
What is the name of the method?
7.
What is the data type of the return value?
8.
How many parameters does it have?
9.
What is the access specifier?
10.
True or False: The method will throw a NotFoundException every time the method is
invoked.
11.
What keyword is used within a constructor to invoke another constructor in the same
class?
12.
True or False: If you write a class and do not put a constructor in it, the compiler
generates a constructor for you.
13.
True or False: Every class must have a no-argument constructor.
14.
When arguments are copied into parameters, this is referred to as
_______________________.
15.
True or False: If a Java method changes a parameter, it changes the corresponding
argument as well.
Search WWH ::




Custom Search