Exam 5: Methods

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

Any method that calls a method with a throws clause in its header must either handle the potential exception or have the same throws clause.

Free
(True/False)
4.7/5
(31)
Correct Answer:
Verified

True

Select all that apply. Which of the following types of values can be passed to a method that has an int parameter variable?

Free
(Multiple Choice)
4.9/5
(38)
Correct Answer:
Verified

D

In the following code, Integer.parseInt(str) is an example of __________. int num; String str = "555"; Num = Integer.parseInt(str) + 5;

Free
(Multiple Choice)
4.9/5
(41)
Correct Answer:
Verified

A

Values stored in local variables __________.

(Multiple Choice)
4.8/5
(46)

The expression in a return statement can be any expression that has a value.

(True/False)
4.8/5
(41)

Select all that apply. Local variables __________.

(Multiple Choice)
4.8/5
(31)

No statement outside the method in which a parameter variable is declared can access the parameter by its name.

(True/False)
4.9/5
(42)

Values that are sent into a method are called __________.

(Multiple Choice)
4.8/5
(38)

In the method header the static method modifier means the method is available to code outside the class.

(True/False)
4.8/5
(33)

The process of breaking a problem down into smaller pieces is sometimes called __________.

(Multiple Choice)
4.8/5
(33)

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

(Multiple Choice)
5.0/5
(38)

In the header, the method name is always followed by __________.

(Multiple Choice)
4.8/5
(41)

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

(Multiple Choice)
4.8/5
(35)

If you attempt to use a local variable before it has been given a value, __________.

(Multiple Choice)
4.8/5
(31)

You should always document a method by writing comments that appear __________.

(Multiple Choice)
4.9/5
(31)

The header of a value-returning method must specify __________.

(Multiple Choice)
4.8/5
(40)

Methods are commonly used to break a problem into small manageable pieces.

(True/False)
4.7/5
(50)

Methods are commonly used to:

(Multiple Choice)
4.8/5
(24)

In a general sense, a method is __________.

(Multiple Choice)
4.8/5
(37)

To document the return value of a method you can use a __________.

(Multiple Choice)
4.9/5
(37)
Showing 1 - 20 of 56
close modal

Filters

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