Exam 7: User-Defined Methods

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

Actual and formal parameters have a one-to-one correspondence.

(True/False)
4.8/5
(41)

The technique to solve a problem by subdividing into smaller problems is known as divide-and- conquer and ____ design approach.

(Multiple Choice)
4.8/5
(38)

The word static is a return type in Java.

(True/False)
4.9/5
(43)

Just like the nesting of loops, Java allows the nesting of methods.

(True/False)
4.9/5
(34)

Which of the following statements about strings is NOT true?

(Multiple Choice)
4.9/5
(28)

An actual parameter is a variable or expression listed in a method call.

(True/False)
4.9/5
(33)

public class scopeRule //Line 1 { //Line 2 Static double intRate = 0.055; //Line 3 Static String name; //Line 4 Static int t; //Line 5 public static int main(String[] args) //Line 6 { //Line 7 Int first; //Line 8 Double u, t; //Line 9 String str; //Line 10 //... //Line 11 } //Line 12 public static int first(int x, int y) //Line 13 { //Line 14 Int t; //Line 15 //... //Line 16 } public static double salary; //Line 17 public static void funcOne(int first, double x) //Line 18 { //Line 19 Char ch; //Line 20 Int y; //Line 21 //block one //Line 22 { //Line 23 Int u = 18; //Line 24 //... //Line 25 } //end block one //Line 26 } //Line 27 } //Line 28Which of the following identifiers seen in the accompanying figure is visible in main?

(Multiple Choice)
4.8/5
(36)

public static double secret(int first, double second) { Double temp; if (second > first) Temp = first * second; Else Temp = first - second; return temp; }Which of the following is a valid call to the method in the accompanying figure?

(Multiple Choice)
5.0/5
(33)

A local identifier is an identifier that is declared within a method or block and that is visible only within that method or block.

(True/False)
4.7/5
(33)

Suppose that the following statement is included in a program.import static java.lang.Math.*;After this statement, a static method of the class Math can be called using just the method name.

(True/False)
4.8/5
(39)
Showing 41 - 50 of 50
close modal

Filters

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