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
(81)
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.8/5
(73)
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
(78)
Correct Answer:
Verified

A

Values stored in local variables __________.

(Multiple Choice)
4.8/5
(86)

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

(True/False)
4.8/5
(80)

Select all that apply. Local variables __________.

(Multiple Choice)
4.8/5
(68)

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

(True/False)
4.9/5
(87)

Values that are sent into a method are called __________.

(Multiple Choice)
4.8/5
(89)

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

(True/False)
4.9/5
(73)

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

(Multiple Choice)
4.8/5
(82)

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

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

(Multiple Choice)
4.8/5
(85)

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

(Multiple Choice)
4.7/5
(78)

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

(Multiple Choice)
4.8/5
(78)

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

(Multiple Choice)
4.9/5
(69)

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

(Multiple Choice)
4.8/5
(79)

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

(True/False)
4.7/5
(94)

Methods are commonly used to:

(Multiple Choice)
4.8/5
(70)

In a general sense, a method is __________.

(Multiple Choice)
4.8/5
(77)

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

(Multiple Choice)
4.8/5
(66)
Showing 1 - 20 of 56
close modal

Filters

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