The oops moment/3
Quiz
•
Engineering
•
University
•
Hard
Mekha S R
FREE Resource
Enhance your content in a minute
10 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the primary reason to use defensive copying when returning a list from a class?
To save memory
To prevent external modification of the internal state
To confuse other developers
To automatically sort the list
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
If you return a list directly from a class and another part of your code modifies it, what OOP principle is being violated?
Encapsulation
Polymorphism
Abstraction
Inheritance
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which collection is better if you’re doing frequent insertions and deletions in the middle of the list?
ArrayList
LinkedList
HashMap
Vector
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
A class allows you to borrow books. You now want to borrow multiple books at once. What should you add?
A loop in the main method
A new method like borrowMultipleBooks()
Delete all books
Make the list static
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What helps prevent an object from reaching an invalid state?
Logging everything
Skipping validations
Enforcing business rules
Using only primitive data types
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Why use getters/setters instead of public variables?
They're shorter to write
They confuse the user
They allow control over how variables are accessed/modified
They are required by Java
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What does it mean for an object to be immutable?
It can’t be accessed by other classes
It can’t be changed after it's created
It’s slower to execute
It throws exceptions when used
Create a free account and access millions of resources
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
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?
Similar Resources on Wayground
12 questions
SACA 18 Introduction to Print Reading
Quiz
•
12th Grade - University
15 questions
Activity 1 - Database Management System
Quiz
•
University
10 questions
Plagiarism
Quiz
•
10th Grade - University
9 questions
STEM 6: U2 L2 Vocab Review
Quiz
•
6th Grade - University
15 questions
SEPM_Mod-1_Quiz
Quiz
•
University
15 questions
C Programming Quiz2
Quiz
•
University
10 questions
Building Quantities Documentation Quiz
Quiz
•
University
15 questions
Topic 5 - Ethics and Professionalism in Civil Eng
Quiz
•
University
Popular Resources on Wayground
20 questions
Halloween Trivia
Quiz
•
6th - 8th Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
15 questions
Order of Operations
Quiz
•
5th Grade
20 questions
Halloween
Quiz
•
5th Grade
16 questions
Halloween
Quiz
•
3rd Grade
12 questions
It's The Great Pumpkin Charlie Brown
Quiz
•
1st - 5th Grade
20 questions
Possessive Nouns
Quiz
•
5th Grade
10 questions
Halloween Traditions and Origins
Interactive video
•
5th - 10th Grade
Discover more resources for Engineering
10 questions
Halloween Movies Trivia
Quiz
•
5th Grade - University
12 questions
Halloween
Quiz
•
3rd Grade - University
5 questions
Using Context Clues
Interactive video
•
4th Grade - University
20 questions
Definite and Indefinite Articles in Spanish (Avancemos)
Quiz
•
8th Grade - University
7 questions
Force and Motion
Interactive video
•
4th Grade - University
14 questions
Eat Healthy,Be Healty
Quiz
•
4th Grade - University
7 questions
History of Halloween: Pagan or Christian?
Interactive video
•
11th Grade - University
7 questions
Renewable and Nonrenewable Resources
Interactive video
•
4th Grade - University
