Services
Discover
Homeschooling
Ask a Question
Log in
Sign up
Filters
Done
Question type:
Essay
Multiple Choice
Short Answer
True False
Matching
Topic
Computing
Study Set
Java Programming From Problem Analysis to Program Design
Quiz 7: User-Defined Methods
Path 4
Access For Free
Share
All types
Filters
Study Flashcards
Practice Exam
Learn
Question 21
Multiple Choice
How can a method send a primitive value back to the caller?
Question 22
Multiple Choice
Which of the following is NOT true about return statements?
Question 23
Multiple Choice
public static char methodHeading(int n, double num) Which of the following statements about the method heading in the accompanying figure is NOT true?
Question 24
True/False
All the methods defined in a class must have different names.
Question 25
Multiple Choice
public static double secret(int first, double second) { Double temp; if (second > first) Temp = first * second; Else Temp = first - second; return temp; }What is the return type of the method in the accompanying figure?
Question 26
True/False
The signature of a method consists of only its formal parameter list.
Question 27
True/False
Within a method, an identifier used to name a variable in the outer block of the method can be used to name any other variable in an inner block of the method.
Question 28
Multiple Choice
public int mystery(int x, int y) { If (x >= y) Return x - y; Else Return x + y; }Based on the code in the accompanying figure, what would be the output of the following statement?System.out.println(mystery(8, mystery(2, 1) ) ;
Question 29
Multiple Choice
public int mystery(int x, int y) { If (x >= y) Return x - y; Else Return x + y; }Based on the code in the accompanying figure, what would be the output of the following statement?System.out.println(mystery(8,7) ) ;
Question 30
Multiple Choice
What is an actual parameter?
Question 31
Multiple Choice
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?