| preferred AP College board partner for AP classes
AP Computer Science A/Unit 5: Writing Classes
Start Practice TestPractice Test
About Exam
medium Solved by 6 students
Class Design and Abstraction Principles
< Prev
Next >

A programmer is refactoring an inventory management system where multiple classes directly access and modify each other’s data. Which refactoring approach best applies abstraction principles to improve the design?

A

Combine all classes into a single large class to eliminate inter-class dependencies and simplify data access

B

Make all methods private and create a single public method in each class that handles all possible operations

C

Convert all instance variables to static variables and make all methods static to eliminate object creation overhead

D

Make all data fields private and create public accessor and mutator methods that encapsulate business rules and validation logic, then decompose complex operations into smaller, focused methods within each class

Hint
Did You Know?
Explain Why
Explain All Answers
Check Answer
Show Correct Answer
Report Question

Question Leaderboard

Rank
User
Correct Count
Attempt Count
Time
Score
#1sailajavadlamani3311 0m 00s 100
#2suhanakochhar00611 1m 14s 26
#3chunxiangxu.cxu01 0m 15s -25
#4y.seong202701 5m 20s -330
Items per page:
10
1 – 4 of 4
No comments yet. Be the first to comment!

AI Tutor

How can I help?

APFIVE © 2020.
Email: apfive@apfive.org|Privacy Policy