Exam 5: Methods

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

Select all that apply. Which of the following are benefits of using methods in programming?

(Multiple Choice)
4.8/5
(70)

When a method tests an argument and returns a true or false value, it should return __________.

(Multiple Choice)
5.0/5
(81)

Given the following method, which of these method calls is valid? public static void showProduct (double num1, int num2) { Double product; Product = num1 * num2; System.out.println("The product is " + product); }

(Multiple Choice)
4.8/5
(73)

A value-returning method must specify __________ as its return type in the method header.

(Multiple Choice)
4.8/5
(75)

In a @return tag statement the description __________.

(Multiple Choice)
4.9/5
(87)

A method

(Multiple Choice)
4.8/5
(83)

When an argument value is passed to a method, the receiving parameter variable is __________.

(Multiple Choice)
4.8/5
(74)

When an object, such as a String, is passed as an argument it is __________.

(Multiple Choice)
4.8/5
(79)

Given the following method header, which of these method calls is incorrect? public void displayValue(double x, int y);

(Multiple Choice)
5.0/5
(79)

All @param tags in a method's documentation must __________.

(Multiple Choice)
4.9/5
(85)

What will be returned from the following method? public static double methodA() { Double a = 8.5 + 9.5; Return a; }

(Multiple Choice)
4.8/5
(92)

You must have a return statement in a value-returning method.

(True/False)
4.8/5
(82)

When writing documentation comments for a method, you can provide a description of each parameter by using a __________.

(Multiple Choice)
4.8/5
(81)

Constants, variables, and the values of expressions may be passed as arguments to a method.

(True/False)
4.8/5
(99)

Which of the following is not a part of a method call?

(Multiple Choice)
4.8/5
(80)

What will be the result after the following code executes? int num; String str = "555"; Num = Integer.parseInt(string str) + 5;

(Multiple Choice)
4.8/5
(85)
Showing 41 - 56 of 56
close modal

Filters

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