Methods
Flashcard
•
Computers
•
University
•
Practice Problem
•
Hard
Wayground Content
FREE Resource
Student preview

8 questions
Show all answers
1.
FLASHCARD QUESTION
Front
What do I put as the return type if I don't want to return anything from a method?
Back
void
2.
FLASHCARD QUESTION
Front
True or False: A method does not need to have any parameters.
Back
True
3.
FLASHCARD QUESTION
Front
What is the correct way to define a method that subtracts two numbers, returning the difference? Options: public static void subtract(int num1, int num2), public static int subtract (int num1, int num2), public static int subtract(String num1, String num2), public static void subtract(int num1, num2)
Back
public static int subtract (int num1, int num2)
4.
FLASHCARD QUESTION
Front
Which of the following statements is false?
A method is good for reusing code.
A method with a return type must return a variable of that return type.
A method must always have at least 1 parameter.
A method with a void return type must not return anything.
Back
A method must always have at least 1 parameter.
5.
FLASHCARD QUESTION
Front
Why is the following call to method minOfTwo, which returns the minimum number of 2 given numbers, incorrect? int min = minOfTwo(8,"9");
Back
The method minOfTwo takes in two integers, but a String is being passed in.
6.
FLASHCARD QUESTION
Front
True or False: There is something incorrect about the following call to the method minOfTwo: int min = minOfTwo(int 8, int 9);
Back
True
7.
FLASHCARD QUESTION
Front
What is wrong with the following code snippet?
public static multiply(int a, int b) {
return a * b;
}
Back
It is missing the int return type in the method definition.
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
6 questions
C Programming - Control Flow
Flashcard
•
KG
3 questions
W5.3
Flashcard
•
KG - University
4 questions
Analytic Phonics
Flashcard
•
University
7 questions
Flashcards Phrasals Get
Flashcard
•
Professional Development
12 questions
system life cycle G12
Flashcard
•
12th Grade
13 questions
ÔN TẬP LÝ THUYẾT LẬP TRÌNH HƯỚNG ĐỐI TƯỢNG (OOP)
Flashcard
•
KG
10 questions
SUP E3 - PART 1
Flashcard
•
University
9 questions
OOPS - PYTHON
Flashcard
•
Professional Development
Popular Resources on Wayground
5 questions
This is not a...winter edition (Drawing game)
Quiz
•
1st - 5th Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
10 questions
Identify Iconic Christmas Movie Scenes
Interactive video
•
6th - 10th Grade
20 questions
Christmas Trivia
Quiz
•
6th - 8th Grade
18 questions
Kids Christmas Trivia
Quiz
•
KG - 5th Grade
11 questions
How well do you know your Christmas Characters?
Lesson
•
3rd Grade
14 questions
Christmas Trivia
Quiz
•
5th Grade
20 questions
How the Grinch Stole Christmas
Quiz
•
5th Grade
Discover more resources for Computers
26 questions
Christmas Movie Trivia
Lesson
•
8th Grade - Professio...
20 questions
christmas songs
Quiz
•
KG - University
20 questions
Holiday Trivia
Quiz
•
9th Grade - University
15 questions
Holiday Movies
Quiz
•
University
14 questions
Christmas Trivia
Quiz
•
3rd Grade - University
20 questions
Christmas Trivia
Quiz
•
University
8 questions
5th, Unit 4, Lesson 8
Lesson
•
KG - Professional Dev...
20 questions
Disney Trivia
Quiz
•
University