
Java Methods Quiz
Authored by Samar Sharkh
Computers
10th - 12th Grade
Used 211+ times

AI Actions
Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...
Content View
Student View
5 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following is the correct syntax for writing a method with parameters?
public static void example(x: int, y: int) {}
public static void example(x, y) {}
public static void example(int x, int y) {}
public static void example(int x,y) {}
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What output is produced by the following program?
"15 42"
"10 25"
"57"
"25"
57
25
"num1 num2"
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Why do we use methods in Java programming?
Break down our program into smaller parts
Avoid repeating code
Make our program more readable
All of the above
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What are parameters?
The value that a method returns.
The values that a method prints to the screen.
The type that is given to a variable.
The formal names given to the data/variables that are passed into a method.
5.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
What is the output of the code below?
public class ExampleVoid {
public static void main(String[] args) {
methodRankPoints(255.7);
}
public static void methodRankPoints(double points) {
if (points >= 202.5) {
System.out.println("Rank:A1");
}else if (points >= 122.4) {
System.out.println("Rank:A2");
}else {
System.out.println("Rank:A3");
}
}
}
Rank:A1
Rank:A2
Rank:A3
No output
Access all questions and much more by creating a free account
Create resources
Host any resource
Get auto-graded reports

Continue with Google

Continue with Email

Continue with Classlink

Continue with Clever
or continue with

Microsoft
%20(1).png)
Apple
Others
Already have an account?
Popular Resources on Wayground
15 questions
Fractions on a Number Line
Quiz
•
3rd Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
22 questions
fractions
Quiz
•
3rd Grade
20 questions
Main Idea and Details
Quiz
•
5th Grade
20 questions
Context Clues
Quiz
•
6th Grade
15 questions
Equivalent Fractions
Quiz
•
4th Grade
20 questions
Figurative Language Review
Quiz
•
6th Grade