Programming - Methods in Java
You Are Here :: Home > JAVA > Methods in Java - General Questions
1.
The __________________, which is optional, tells the compiler how to call the method.
A.
modifier
B.
Directory
C.
File or Directory
D.
File
Answer: Option A
Explanation:
The modifier which is optional, tells the compiler how to call the method.
2.
A _____________ is like a placeholder.
A.
parameter
B.
variable
C.
object
D.
class
Answer: Option B
Explanation:
A variable is like a placeholder.
3.
When a program calls a method, ________________ is transferred to the called method.
A.
program control
B.
program access
C.
program denied
D.
program file
Answer: Option A
Explanation:
When a program calls a method, program control is transferred to the called method.
4.
When calling a method, you need to provide arguments, which must be given in the same order as their respective parameters in the method specification.This is known as ________________.
A.
parameter order association
B.
loop order association
C.
control order association
D.
none
Answer: Option A
Explanation:
When calling a method, you need to provide arguments, which must be given in the same order as their respective parameters in the method specification.This is known as parameter order association.
5.
The ___________ of a variable is the part of the program where the variable can be referenced.
A.
scope
B.
vision
C.
loop
D.
static
Answer: Option A
Explanation:
The scope of a variable is the part of the program where the variable can be referenced.
6.
A _______________________ is the information that directly follows the program's name on the command line when it is executed.
A.
command-line argument
B.
static argument
C.
non-static argument
D.
programic argument
Answer: Option A
Explanation:
A command-line arguemnt is the information that directly follows the program's name on the command line when it is executed.
next »