2.3-4-5 Calling a (non-)Void Method (with Parameters)

Quiz
•
Education
•
Professional Development
•
Hard
Sinan BAL
Used 3+ times
FREE Resource
14 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following is a correctly written method for the class on the left?
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following correctly calls the method addFiveMinutes on an object of the Timer class called kitchenTimer?
kitchenTimer(addFiveMinutes);
Timer.addFiveMinutes();
kitchenTimer.addFiveMinutes();
kitchenTimer.addFiveMinutes;
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Suppose the class Timer has a method called startTime that prints out the starting time of the Timer.
Which of the following correctly uses this method to print out the start time of a Timer object called laundry?
System.out.println(laundry.startTime());
System.out.println(laundry.startTime);
int start = laundry.startTime();
laundry.startTime();
laundry.startTime;
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
A Timer class is a class that represents a minute timer. A partial definition of the class is given on the left.
The timer will end in 30 minutes
The timer will end in 30 minutes
The timer will end in 35 minutes
The timer will end in 30 minutes
The timer will end in 30 minutes
This method won’t print anything because it doesn’t have any print statements.
5.
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 formal names given to the data that gets passed into a method.
The type that is given to a variable.
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Consider the Circle class on the left.
24.0
20.0
24.0
24.0
Nothing will print because the code contains an error.
24.0
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Consider the class on the left:
If a new variable Rectangle shape = new Rectangle(10, 20); was initialized, what is the correct syntax for retrieving the area of shape?
int area = Rectangle.getArea();
int area = shape.getArea();
shape.getArea(10,20);
Rectangle.getHeight() * Rectangle.getWidth();
shape.getArea();
Create a free account and access millions of resources
Similar Resources on Wayground
10 questions
Supply PKT - Week 1 - Mar'23

Quiz
•
Professional Development
10 questions
Python quiz

Quiz
•
KG - Professional Dev...
10 questions
PruBSN Aspirasi 101

Quiz
•
Professional Development
10 questions
ACA 101: Post Enrollment - FAQ

Quiz
•
Professional Development
10 questions
Supply PKT-Week 3-Jan '23

Quiz
•
Professional Development
10 questions
UHT QUZ (CMD2)

Quiz
•
Professional Development
10 questions
KUIS PJJ PENGAWAS

Quiz
•
Professional Development
10 questions
Java Strings

Quiz
•
1st Grade - Professio...
Popular Resources on Wayground
10 questions
Lab Safety Procedures and Guidelines

Interactive video
•
6th - 10th Grade
10 questions
Nouns, nouns, nouns

Quiz
•
3rd Grade
10 questions
9/11 Experience and Reflections

Interactive video
•
10th - 12th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
11 questions
All about me

Quiz
•
Professional Development
22 questions
Adding Integers

Quiz
•
6th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
9 questions
Tips & Tricks

Lesson
•
6th - 8th Grade
Discover more resources for Education
11 questions
All about me

Quiz
•
Professional Development
10 questions
How to Email your Teacher

Quiz
•
Professional Development
15 questions
Fun Random Trivia

Quiz
•
Professional Development
22 questions
Anne Bradstreet 1612-1672

Quiz
•
Professional Development
18 questions
Spanish Speaking Countries and Capitals

Quiz
•
KG - Professional Dev...
14 questions
Fall Trivia

Quiz
•
11th Grade - Professi...
15 questions
Disney Characters Quiz

Quiz
•
Professional Development
15 questions
Quiz to Highlight Q types & other great features in Wayground

Quiz
•
Professional Development