Exam 7: User-Defined Methods

arrow
  • Select Tags
search iconSearch Question
flashcardsStudy Flashcards
  • Select Tags

Formal parameters of primitive data types provide ____ between actual parameters and formal parameters.

Free
(Multiple Choice)
4.7/5
(34)
Correct Answer:
Verified

A

Just like the nesting of loops, Java allows the nesting of methods.

Free
(True/False)
4.8/5
(26)
Correct Answer:
Verified

False

Methods are also called modules.

Free
(True/False)
4.9/5
(38)
Correct Answer:
Verified

True

What is an actual parameter?

(Multiple Choice)
4.7/5
(28)

What is the return type of the method in the accompanying figure?

(Multiple Choice)
4.7/5
(35)

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)
4.7/5
(43)

Based on the method heading in the accompanying figure, what is the return type of the value returned?

(Multiple Choice)
4.9/5
(42)

An identifier can be declared anywhere including within a class, and outside of every method definition (and every block).

(True/False)
4.7/5
(38)

How can a method send a primitive value back to the caller?

(Multiple Choice)
4.9/5
(31)

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)
4.9/5
(39)

The class Math is contained in the package java.math.

(True/False)
4.9/5
(45)

Java allows the programmer to declare a variable in the initialization statement of the for statement.

(True/False)
4.9/5
(37)

Based on the code in the accompanying figure, what would be the output of the following statement? System.out.println(mystery(8, mystery(2, 1));

(Multiple Choice)
4.8/5
(41)

The signature of a method consists of only its formal parameter list.

(True/False)
4.7/5
(37)

Which of the following identifiers seen in the accompanying figure is visible in block one?

(Multiple Choice)
4.9/5
(33)

What is the name of the method in the accompanying figure?

(Multiple Choice)
4.8/5
(31)

Which of the following identifiers seen in the accompanying figure is NOT visible in method funcOne?

(Multiple Choice)
4.9/5
(43)

Actual and formal parameters have a one-to-one correspondence.

(True/False)
4.8/5
(34)

The word static is a return type in Java.

(True/False)
4.8/5
(33)

All the methods defined in a class must have different names.

(True/False)
5.0/5
(36)
Showing 1 - 20 of 50
close modal

Filters

  • Essay(0)
  • Multiple Choice(0)
  • Short Answer(0)
  • True False(0)
  • Matching(0)