FC0-U61 · Question #531
Which of the following would be the BEST design construct to allow developers to group functions and properties for reuse when designing an application?
The correct answer is D. Class. In object-oriented programming, a class is the best design construct for grouping related functions (methods) and properties (attributes) for reusability and creating objects. It serves as a blueprint for objects.
Question
Which of the following would be the BEST design construct to allow developers to group functions and properties for reuse when designing an application?
Options
- AConstant
- BVector
- CFunction
- DClass
How the community answered
(16 responses)- B6% (1)
- D94% (15)
Why each option
In object-oriented programming, a class is the best design construct for grouping related functions (methods) and properties (attributes) for reusability and creating objects. It serves as a blueprint for objects.
A constant is a fixed value that cannot be changed during program execution and does not group functions or properties.
A vector is a data structure, often an array, used to store a collection of elements of the same type, not to group functions and properties for reuse.
A function (or method) is a block of organized, reusable code that performs a single, specific action, but it doesn't serve as a blueprint for grouping both functions and properties into a cohesive unit.
A class is a blueprint for creating objects, allowing developers to define a collection of related functions (methods) and properties (attributes) that encapsulate a specific entity or concept. This object-oriented programming construct promotes code reusability, modularity, and easier maintenance by creating instances (objects) from the class.
Concept tested: Object-oriented programming - Class
Source: https://learn.microsoft.com/en-us/dotnet/csharp/fundamentals/tutorials/oop
Topics
Community Discussion
No community discussion yet for this question.