| preferred AP College board partner for AP classes
medium Solved by 4 students
Class Design and Abstraction Principles
< Prev
Next >

Represent the design of a program by using natural language or creating diagrams that indicate the classes in the program and the data and procedural abstractions found in each class by including all attributes and behaviors.
A programmer needs to refactor a complex inventory management system where multiple classes directly access and modify each other’s data fields. Which refactoring approach best applies abstraction principles to improve the design?

A

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

B

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

C

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

D

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

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

Question Leaderboard

Rank
User
Correct Count
Attempt Count
Time
Score
#1sailajavadlamani3311 0m 00s 100
#2suhanakochhar00611 1m 14s 26
#3y.seong202701 5m 20s -330
APFIVE © 2020.
Email: [email protected]|Privacy Policy