Exam 7: User-Defined Methods

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

Two methods are said to have different formal parameter lists if both methods have a different number of formal parameters, or if the data types of the formal parameters are the same.

(True/False)
4.9/5
(47)

Void methods use the return statement to return the value 0.

(True/False)
4.8/5
(39)

Reference variables as parameters allow you to return more than one value from a method.

(True/False)
4.8/5
(36)

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

(Multiple Choice)
4.9/5
(27)

To use a predefined method, you must know the code in the body of the method.

(True/False)
4.9/5
(33)

Which of the following is a valid call to the method in the accompanying figure?

(Multiple Choice)
4.9/5
(33)

Given the method heading in the accompanying figure, which of the following does NOT demonstrate method overloading?

(Multiple Choice)
4.7/5
(39)

Which of the following is NOT part of the heading of the method in the accompanying figure?

(Multiple Choice)
4.8/5
(45)

You can use the class String to pass strings as parameters to a method and change the actual parameter.

(True/False)
4.8/5
(39)

Void methods must have at least one parameter.

(True/False)
4.9/5
(37)

Strings assigned to StringBuffer variables can be altered.

(True/False)
4.8/5
(43)

Based on the code in the accompanying figure, what would be the output of the following statement? System.out.println(secret(5, 7.0));

(Multiple Choice)
5.0/5
(41)

Given the method heading in the accompanying figure, which of the following would be an incorrect demonstration of method overloading?

(Multiple Choice)
4.7/5
(33)

An actual parameter is a variable or expression listed in a method call.

(True/False)
4.8/5
(36)

Within a method, an identifier used to name a variable in the outer block of the method can be used to name any other variable in an inner block of the method.

(True/False)
4.8/5
(35)

Which of the following statements about strings is NOT true?

(Multiple Choice)
4.9/5
(38)

When a program executes, the first statement to execute is always the first statement in the main method.

(True/False)
4.7/5
(31)

The technique to solve a problem by subdividing into smaller problems is known as divide-and- conquer and ____ design approach.

(Multiple Choice)
4.8/5
(41)

Which of the following statements about the method heading in the accompanying figure is NOT true?

(Multiple Choice)
4.9/5
(34)

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

(Multiple Choice)
4.9/5
(37)
Showing 21 - 40 of 50
close modal

Filters

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