Which of the following is the correct syntax for writing a method with parameters?

Java Methods Quiz

Quiz
•
Computers
•
10th - 12th Grade
•
Easy
Samar Sharkh
Used 207+ times
FREE Resource
Student preview

5 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
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
Popular Resources on Wayground
25 questions
Equations of Circles

Quiz
•
10th - 11th Grade
30 questions
Week 5 Memory Builder 1 (Multiplication and Division Facts)

Quiz
•
9th Grade
33 questions
Unit 3 Summative - Summer School: Immune System

Quiz
•
10th Grade
10 questions
Writing and Identifying Ratios Practice

Quiz
•
5th - 6th Grade
36 questions
Prime and Composite Numbers

Quiz
•
5th Grade
14 questions
Exterior and Interior angles of Polygons

Quiz
•
8th Grade
37 questions
Camp Re-cap Week 1 (no regression)

Quiz
•
9th - 12th Grade
46 questions
Biology Semester 1 Review

Quiz
•
10th Grade