Java Programming

Computing

Quiz 7 :

User-Defined Methods

Quiz 7 :

User-Defined Methods

Question Type
search
arrow
Void methods must have at least one parameter.
Free
True False
Answer:

Answer:

False

Tags
Choose question tag
close menu
arrow
An identifier can be declared anywhere including within a class, and outside of every method definition (and every block).
Free
True False
Answer:

Answer:

True

Tags
Choose question tag
close menu
arrow
Just like the nesting of loops, Java allows the nesting of methods.
Free
True False
Answer:

Answer:

False

Tags
Choose question tag
close menu
arrow
In order to use the method isUpperCase of the class Character, the package java.lang must be explicitly imported.
True False
Answer:
Tags
Choose question tag
close menu
arrow
A local identifier is an identifier that is declared within a method or block and that is visible only within that method or block.
True False
Answer:
Tags
Choose question tag
close menu
arrow
Void methods use the return statement to return the value 0.
True False
Answer:
Tags
Choose question tag
close menu
arrow
The class Math is contained in the package java.math.
True False
Answer:
Tags
Choose question tag
close menu
arrow
If a formal parameter is a variable of a primitive data type, then after copying the value of the actual parameter, there is no connection between the formal and actual parameter.
True False
Answer:
Tags
Choose question tag
close menu
arrow
When a program executes, the first statement to execute is always the first statement in the main method.
True False
Answer:
Tags
Choose question tag
close menu
arrow
Suppose that the following statement is included in a program. import static java.lang.Math.*; After this statement, a static method of the class Math can be called using just the method name.
True False
Answer:
Tags
Choose question tag
close menu
arrow
You can use the class String to pass strings as parameters to a method and change the actual parameter.
True False
Answer:
Tags
Choose question tag
close menu
arrow
Methods are also called modules.
True False
Answer:
Tags
Choose question tag
close menu
arrow
An actual parameter is a variable or expression listed in a method call.
True False
Answer:
Tags
Choose question tag
close menu
arrow
Strings assigned to StringBuffer variables can be altered.
True False
Answer:
Tags
Choose question tag
close menu
arrow
Reference variables as parameters allow you to return more than one value from a method.
True False
Answer:
Tags
Choose question tag
close menu
arrow
The return statement must be the last line of the method.
True False
Answer:
Tags
Choose question tag
close menu
arrow
The word static is a return type in Java.
True False
Answer:
Tags
Choose question tag
close menu
arrow
To use a predefined method, you must know the code in the body of the method.
True False
Answer:
Tags
Choose question tag
close menu
arrow
In Java, return is a reserved word.
True False
Answer:
Tags
Choose question tag
close menu
arrow
Actual and formal parameters have a one-to-one correspondence.
True False
Answer:
Tags
Choose question tag
close menu
Showing 1 - 20 of 50