When a variable is declared within a method and its scope is within the method it is known as
a(n)
A) global variable.
B) actual parameter.
C) local variable.
D) public instance data. - ANS-C) local variable.
The parameters in the method call (actual parameters) and the method header (formal
parameters) must be the same in
A) Data type.
B) Sequence.
C) Quantity.
D) All of the other choices - ANS-D) All of the other choices
A distinguishing feature of methods that have the reserved word void in the method header is
that they have
A) None of the other answers
B) No return statements.
C) Multiple return statements.
D) A single return statement. - ANS-B) No return statements.
Methods can return only primitive data types. True/False - ANS-False
Formal parameters in method headers require including the data type for each parameter in
source code. True/False - ANS-True
All method (function) headers must include parameters. True/False - ANS-False
The body of a method can be empty. True/False - ANS-True
All methods must have a return statement. True/False - ANS-False