Exam 5: Methods

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

If you attempt to use a local variable before it has been given a value:

(Multiple Choice)
4.8/5
(75)

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

(Multiple Choice)
5.0/5
(78)

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

(True/False)
5.0/5
(66)

A special variable that holds a value being passed into a method is called what?

(Multiple Choice)
4.8/5
(78)

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

(True/False)
4.9/5
(77)

A parameter variable's scope is:

(Multiple Choice)
4.9/5
(83)

Values that are sent into a method are called:

(Multiple Choice)
4.7/5
(99)

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

(True/False)
4.8/5
(90)

What will be the result of the following code? Int num; String str = "555"; Num = Integer.parseInt(string str) + 5;

(Multiple Choice)
5.0/5
(72)

When a method tests an argument and returns a true or False value, it should return:

(Multiple Choice)
4.9/5
(83)

Given the following method header, which of the method calls would be an error? Public void displayValues(int x, int y)

(Multiple Choice)
4.9/5
(69)

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

(Multiple Choice)
4.8/5
(86)

Which of the following is NOT a benefit derived from using methods in programming?

(Multiple Choice)
4.8/5
(75)

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

(True/False)
4.8/5
(74)

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

Which of the following is included in a method call?

(Multiple Choice)
4.9/5
(81)

To create a method you must write its:

(Multiple Choice)
4.7/5
(83)

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

(True/False)
4.8/5
(67)

In a @return tag statement the description:

(Multiple Choice)
4.9/5
(74)

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.9/5
(90)
Showing 41 - 60 of 60
close modal

Filters

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