A(n) ____ causes a value to be sent from a called method back to the calling method

Search for Content on Methods in Java

Quiz
•
Computers
•
11th - 12th Grade
•
Hard
Thomas Martinez
FREE Resource
10 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
method statement
return statement
initialization
assignment
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following could be the last legally coded line of a method declared as
public static int getVal(double sum)?
return;
return 77;
return 2.3;
Any of these could be the last coded line of the method
3.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
Consider the following two methods:
public int profit(int x, int y) {
return x + y;
}
public int appeals(int x, int y) {
return x * y;
}
What would the value of z be if the following equation were implemented?
int z = appeals(6, profit(9, 7));
63
44
96
75
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following methods can be terminated by an empty return statement?
I. public static void func1()
II. public static int func1()
III. public static String func1()
I only
II only
III only
I and II
II and III
5.
MULTIPLE CHOICE QUESTION
3 mins • 1 pt
What is the final output of the code segment below?
public class Sample {
public static void main(String[] args) {
int x = 5;
x = mystery(x + 1);
11
System.out.println(x);
}
public static int mystery(int x) {
int s = 0;
for (int I =1;i<x-1;i++){
s=s+x;
}
return s;
}}
12
10
24
28
6.
MULTIPLE CHOICE QUESTION
3 mins • 1 pt
What does this program print?
public static int mystery(int x)
{
int y = x * x;
return y;
}
public static void main(String[] args) {
int a = 4;
System.out.println(mystery(a + 1));
}
20
12
22
25
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following is true about a void method?
I. The method returns a boolean value
II. The method does not return any value
III. The method has a void return type
I only
II only
III only
I and II only
II and III only
Create a free account and access millions of resources
Similar Resources on Quizizz
14 questions
Exploring Computer Science

Quiz
•
10th - 12th Grade
6 questions
AP CSA 5.4 / 5.5 (Getters / Setters)

Quiz
•
10th - 12th Grade
15 questions
Control statements in C++

Quiz
•
9th - 12th Grade
15 questions
C# Concepts and Code Quiz

Quiz
•
12th Grade
14 questions
PBO KELAS 12

Quiz
•
12th Grade
10 questions
Programming Basics

Quiz
•
11th - 12th Grade
15 questions
Java Level 1 - B

Quiz
•
12th Grade
14 questions
CSA 1.1.1 Why Programming? Why Java?

Quiz
•
10th - 12th Grade
Popular Resources on Quizizz
15 questions
Character Analysis

Quiz
•
4th Grade
17 questions
Chapter 12 - Doing the Right Thing

Quiz
•
9th - 12th Grade
10 questions
American Flag

Quiz
•
1st - 2nd Grade
20 questions
Reading Comprehension

Quiz
•
5th Grade
30 questions
Linear Inequalities

Quiz
•
9th - 12th Grade
20 questions
Types of Credit

Quiz
•
9th - 12th Grade
18 questions
Full S.T.E.A.M. Ahead Summer Academy Pre-Test 24-25

Quiz
•
5th Grade
14 questions
Misplaced and Dangling Modifiers

Quiz
•
6th - 8th Grade
Discover more resources for Computers
17 questions
Chapter 12 - Doing the Right Thing

Quiz
•
9th - 12th Grade
30 questions
Linear Inequalities

Quiz
•
9th - 12th Grade
20 questions
Types of Credit

Quiz
•
9th - 12th Grade
20 questions
Taxes

Quiz
•
9th - 12th Grade
17 questions
Parts of Speech

Quiz
•
7th - 12th Grade
20 questions
Chapter 3 - Making a Good Impression

Quiz
•
9th - 12th Grade
20 questions
Inequalities Graphing

Quiz
•
9th - 12th Grade
10 questions
Identifying equations

Quiz
•
KG - University