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

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

(Multiple Choice)
4.9/5
(34)

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

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

(Multiple Choice)
4.8/5
(33)

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

(True/False)
4.8/5
(32)

A parameter variable's scope is:

(Multiple Choice)
4.9/5
(39)

Values that are sent into a method are called:

(Multiple Choice)
4.7/5
(50)

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

(True/False)
4.7/5
(42)

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

(Multiple Choice)
4.9/5
(35)

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

(Multiple Choice)
4.9/5
(38)

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

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

(Multiple Choice)
4.8/5
(42)

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

(Multiple Choice)
4.7/5
(31)

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

(True/False)
4.7/5
(37)

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

Which of the following is included in a method call?

(Multiple Choice)
4.9/5
(34)

To create a method you must write its:

(Multiple Choice)
4.7/5
(37)

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

(True/False)
4.8/5
(32)

In a @return tag statement the description:

(Multiple Choice)
4.9/5
(30)

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
(41)
Showing 41 - 60 of 60
close modal

Filters

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