
Java methods
Authored by Mike Skramstad
Computers
9th - 12th Grade
Used 4+ times

AI Actions
Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...
Content View
Student View
15 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
Create a Java function called mystery that takes two Strings and returns a String.
2.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
Write a Java method named calculateSum that takes two integers and returns their sum as an integer.
public int calculateSum(int num1, int num2) { // method body }
public void calculateSum(int num1, int num2) { // method body }
public int calculateSum(double num1, double num2) { // method body }
public double calculateSum(int num1, int num2) { // method body }
3.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
Define a Java method called isEven that takes an integer and returns a boolean indicating whether the number is even.
public boolean isEven(int number) { // method body }
public int isEven(int number) { // method body }
public void isEven(int number) { // method body }
public boolean isEven(double number) { // method body }
4.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
Implement a Java function named concatenateStrings that takes two strings and returns their concatenation.
public String concatenateStrings(String str1, String str2) { // function body }
public void concatenateStrings(String str1, String str2) { // function body }
public String concatenateStrings(String str) { // function body }
public int concatenateStrings(String str1, String str2) { // function body }
5.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
Develop a Java method named findMaximum that takes two integers and returns the larger of the two.
public int findMaximum(int num1, int num2) { // method body }
public void findMaximum(int num1, int num2) { // method body }
public double findMaximum(double num1, double num2) { // method body }
public int findMaximum(int num) { // method body }
6.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
Write a Java function called reverseString that takes a string as input and returns the string in reverse order.
public String reverseString(String str) { // function body }
public void reverseString(String str) { // function body }
public String reverseString() { // function body }
public int reverseString(String str) { // function body }
7.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
Construct a Java method named isPrime that takes an integer and returns a boolean indicating whether the number is a prime number.
public boolean isPrime(int number) { // method body }
public int isPrime(int number) { // method body }
public void isPrime(int number) { // method body }
public boolean isPrime(double number) { // method body }
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?
Similar Resources on Wayground
10 questions
INTRODUCCION A LA PROGRAMACION
Quiz
•
6th Grade - University
10 questions
2025 python class first quiz
Quiz
•
9th Grade - University
10 questions
Cybersecurity Fundamentals Week 2 Quiz
Quiz
•
KG - University
20 questions
Quiz 4
Quiz
•
1st - 10th Grade
12 questions
Python_基礎觀念
Quiz
•
9th Grade
15 questions
# REVIEW 1 DATA TYPES
Quiz
•
10th Grade
20 questions
Introducción a las bases de datos
Quiz
•
12th Grade
15 questions
LATIHAN SOAL PEMROGRAMAN
Quiz
•
9th Grade - University
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