Principles of Object Oriented Flashcards
Why do we need real-world objects in our software projects?
A. They make the code run faster.
B. They help automate business processes by representing business-related entities.
C. They reduce the cost of hardware.
D. They are required for all programming languages.
B - They help automate business processes by representing business-related entities.
In object-oriented programming, what is an object?
A. A reusable function.
B. A thing or entity with its own identity.
C. A type of loop.
D. A programming error.
B - A thing or entity with its own identity.
What is the process of creating an object from a class called?
A. Inheritance.
B. Compilation.
C. Instantiation.
D. Abstraction.
C - Instantiation.
In the provided example, “Ahmad” and “Husain” are:
A. Classes.
B. Methods.
C. Instances of the Employee class.
D. Properties.
C - Instances of the Employee class.
What is a class in object-oriented programming?
A. A template or blueprint for objects.
B. An individual object.
C. A type of variable.
D. A programming language.
A - A template or blueprint for objects.
What do all objects have?
A. Attributes only.
B. Behaviors only.
C. Both attributes and behaviors.
D. Neither attributes nor behaviors.
C - Both attributes and behaviors.
In code, what is an object’s attribute referred to as?
A. Method.
B. Property.
C. Class.
D. Type.
B - Property.
In code, an object’s behavior is referred to as a:
A. Property.
B. Type.
C. Method.
D. Variable.
C - Method.
What does OOAD stand for?
A. Object-Oriented Application Development.
B. Object-Oriented Analysis and Design.
C. Object Operation and Data.
D. Object-Oriented Algorithm Development.
B - Object-Oriented Analysis and Design.
Why is it important to review the design before writing any code in OOAD?
A. To ensure the code runs faster.
B. To decide on the programming language.
C. To verify that the design satisfies the project requirements.
D. To allocate budget for the project.
C - To verify that the design satisfies the project requirements.
Which of the following languages is an example of an object-oriented programming language?
A. C#
B. C
C. Assembly
D. HTML
A - C#
In object-oriented programming, what is referred to as a “Type” in code?
A. The object’s name.
B. The object’s method.
C. The object’s property.
D. The object’s class.
D - The object’s class.
What is the main goal of Object-Oriented Analysis and Design (OOAD)?
A. To create faster algorithms.
B. To analyze and design a system from an object-oriented perspective.
C. To eliminate the need for objects.
D. To simplify database management.
B - To analyze and design a system from an object-oriented perspective.
Which statement is true about classes and objects?
A. Objects are blueprints for classes.
B. Classes are instances of objects.
C. Classes come after objects.
D. Objects are instances of classes.
D - Objects are instances of classes.
Why are objects considered reusable components?
A. They can be used across different programs without modification.
B. They are deleted after use.
C. They are only used once in a program.
D. They cannot be altered once created.
A - They can be used across different programs without modification.