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.7/5
(30)

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

(Multiple Choice)
5.0/5
(39)

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
(34)

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

(Multiple Choice)
4.8/5
(33)

In a @return tag statement the description __________.

(Multiple Choice)
4.9/5
(40)

A method

(Multiple Choice)
4.8/5
(37)

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

(Multiple Choice)
4.8/5
(38)

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

(Multiple Choice)
4.8/5
(37)

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

(Multiple Choice)
4.9/5
(31)

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

(Multiple Choice)
4.9/5
(44)

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
(46)

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

(True/False)
4.8/5
(34)

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

(Multiple Choice)
4.8/5
(41)

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

(True/False)
4.8/5
(49)

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

(Multiple Choice)
4.8/5
(37)

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
(39)
Showing 41 - 56 of 56
close modal

Filters

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