Exam 5: Methods

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

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

Free
(True/False)
4.8/5
(34)
Correct Answer:
Verified

True

In a general sense,a method is

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

D

This part of a method is a collection of statements that are performed when the method is executed.

Free
(Multiple Choice)
4.8/5
(34)
Correct Answer:
Verified

C

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

(Multiple Choice)
4.8/5
(34)

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

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

(True/False)
4.8/5
(30)

To document the return value of a method,use this in a documentation comment.

(Multiple Choice)
4.8/5
(38)

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.

(True/False)
4.9/5
(34)

Which of the following would be a valid method call for the following method? 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
(32)

Any method that calls a method with a throws clause in its header must

(Multiple Choice)
4.9/5
(36)

When an argument is passed to a method,

(Multiple Choice)
4.8/5
(43)

You should always document a method by writing comments that appear

(Multiple Choice)
4.7/5
(39)

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

(Multiple Choice)
4.7/5
(35)

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

(True/False)
4.8/5
(35)

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

(Multiple Choice)
4.8/5
(41)

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

(Multiple Choice)
4.8/5
(33)

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

(Multiple Choice)
4.9/5
(32)

The lifetime of a method's local variable is

(Multiple Choice)
4.8/5
(40)

Methods are commonly used to

(Multiple Choice)
4.8/5
(37)

Local variables can be initialized with

(Multiple Choice)
4.8/5
(39)
Showing 1 - 20 of 50
close modal

Filters

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