Ready to test your Knowledge?
Try out our new practice tests completely free!
exam preparation banner icon

Starting Out with Java Study Set 1

Computing

Quiz 5 :

Methods

Quiz 5 :

Methods

search
arrow
A __________ is a part of a method that contains a collection of statements that are performed when the method is executed.
Free
Multiple Choice
Answer:

Answer:

C

Tags
Choose question tag
close menu
arrow
Two general categories of methods are void methods and value-returning methods.
Free
True False
Answer:

Answer:

True

Tags
Choose question tag
close menu
arrow
In the header, the method name is always followed by __________.
Free
Multiple Choice
Answer:

Answer:

A

Tags
Choose question tag
close menu
arrow
To create a method, you must write its __________.
Multiple Choice
Answer:
Tags
Choose question tag
close menu
arrow
Which type of method performs a task and sends a value back to the code that called it?
Multiple Choice
Answer:
Tags
Choose question tag
close menu
arrow
You must have a return statement in a value-returning method.
True False
Answer:
Tags
Choose question tag
close menu
arrow
Methods are commonly used to break a problem into small manageable pieces.
True False
Answer:
Tags
Choose question tag
close menu
arrow
In the method header the static method modifier means the method is available to code outside the class.
True False
Answer:
Tags
Choose question tag
close menu
arrow
Which of the following is not a part of a method call?
Multiple Choice
Answer:
Tags
Choose question tag
close menu
arrow
Deep Check -If method A calls method B, and method B calls method C, and method C calls method D, when method D finishes, what happens?
Multiple Choice
Answer:
Tags
Choose question tag
close menu
arrow
A parameter variable's scope is the method in which the parameter is declared.
True False
Answer:
Tags
Choose question tag
close menu
arrow
Constants, variables, and the values of expressions may be passed as arguments to a method.
True False
Answer:
Tags
Choose question tag
close menu
arrow
The expression in a return statement can be any expression that has a value.
True False
Answer:
Tags
Choose question tag
close menu
arrow
Methods are commonly used to:
Multiple Choice
Answer:
Tags
Choose question tag
close menu
arrow
No statement outside the method in which a parameter variable is declared can access the parameter by its name.
True False
Answer:
Tags
Choose question tag
close menu
arrow
A value-returning method can return a reference to a non-primitive type.
True False
Answer:
Tags
Choose question tag
close menu
arrow
In the method header, the method modifier public means that the method belongs to the class, not a specific object.
True False
Answer:
Tags
Choose question tag
close menu
arrow
Any method that calls a method with a throws clause in its header must either handle the potential exception or have the same throws clause.
True False
Answer:
Tags
Choose question tag
close menu
arrow
Only constants and variables may be passed as arguments to methods.
True False
Answer:
Tags
Choose question tag
close menu
arrow
In the following code, System.out.println(num) is an example of __________. double num = 5.4; System.out.println(num); Num = 0.0;
Multiple Choice
Answer:
Tags
Choose question tag
close menu
Showing 1 - 20 of 56