Exam 5: Methods

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

A parameter variable's scope is __________.

(Multiple Choice)
4.9/5
(40)

Select all that apply. Any method that calls a method with a throws clause in its header must __________.

(Multiple Choice)
4.8/5
(31)

A special variable that holds a value being passed into a method is called a(n) __________.

(Multiple Choice)
4.8/5
(44)

When you pass an argument to a method you should be sure that the argument's type is compatible with __________.

(Multiple Choice)
4.8/5
(40)

A value-returning method can return a reference to a non-primitive type.

(True/False)
4.9/5
(32)

A __________ type of method performs a task and then terminates.

(Multiple Choice)
4.9/5
(39)

If method A calls method B, and method B calls method C, and method C calls method D, when method D finishes, what happens?

(Multiple Choice)
4.8/5
(40)

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

(Multiple Choice)
4.8/5
(25)

Two general categories of methods are void methods and value-returning methods.

(True/False)
4.9/5
(32)

Only constants and variables may be passed as arguments to methods.

(True/False)
4.9/5
(46)

The lifetime of a method's local variable is __________.

(Multiple Choice)
4.7/5
(37)

A parameter variable's scope is the method in which the parameter is declared.

(True/False)
4.8/5
(30)

To create a method, you must write its __________.

(Multiple Choice)
4.9/5
(32)

In the method header, the method modifier public means that the method belongs to the class, not a specific object.

(True/False)
4.9/5
(35)

In the following code, System.out.println(num) is an example of __________. double num = 5.4; System.out.println(num); Num = 0.0;

(Multiple Choice)
4.9/5
(30)

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

(Multiple Choice)
4.9/5
(39)

Local variables can be initialized with __________.

(Multiple Choice)
4.9/5
(42)

When an argument is passed to a method __________.

(Multiple Choice)
4.8/5
(38)

Which type of method performs a task and sends a value back to the code that called it?

(Multiple Choice)
4.8/5
(39)

A __________ is a part of a method that contains a collection of statements that are performed when the method is executed.

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

Filters

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