OBJECT ORIENTED TECHINIQUES
1. What does OOAD stand for?
a) Object Oriented Analysis and Design
b) Online Object Analysis and Design
c) Objective Oriented Analysis and Documentation
d) Objective Oriented Algorithm Design
Answer: a) Object Oriented Analysis and Design
2. What is the purpose of object-oriented analysis?
a) To identify the objects and their attributes
b) To define the system requirements
c) To model the system using object-oriented concepts
d) All of the above
Answer: d) All of the above
3. What is the purpose of object-oriented design?
a) To identify the objects and their attributes
b) To define the system requirements
c) To model the system using object-oriented concepts
d) To develop the code for the system
Answer: d) To develop the code for the system
4. What is encapsulation?
a) Hiding the complexity of the object from the user
b) Hiding the object from the user
c) Hiding the methods of the object from the user
d) None of the above
Answer: a) Hiding the complexity of the object from the user
5. What is inheritance?
a) The process of creating a new class from an existing class
b) The process of creating an object from a class
c) The process of creating a subclass from a superclass
d) None of the above
Answer: c) The process of creating a subclass from a superclass
6. What is polymorphism?
a) The ability of an object to take on many forms
b) The ability of a method to take on many forms
c) The ability of a class to take on many forms
d) None of the above
Answer: b) The ability of a method to take on many forms
7. What is a class?
a) A blueprint for creating objects
b) An object
c) A method
d) None of the above
Answer: a) A blueprint for creating objects
8. What is an object?
a) A blueprint for creating classes
b) An instance of a class
c) A method
d) None of the above
Answer: b) An instance of a class
9. What is a constructor?
a) A method used to create objects
b) A method used to destroy objects
c) A method used to modify objects
d) None of the above
Answer: a) A method used to create objects
10. What is a method?
a) A method used to create objects
b) A method used to destroy objects
c) A method used to modify objects
d) None of the above
Answer: c) A method used to modify objects
11. What is a superclass?
a) A class that inherits from another class
b) A class from which other classes are derived
c) A class that is used to create objects
d) None of the above
Answer: b) A class from which other classes are derived
12. What is a subclass?
a) A class that inherits from another class
b) A class from which other classes are derived
c) A class that is used to create objects
d) None of the above
Answer: a) A class that inherits from another class
13. What is a UML diagram?
a) A diagram used to model object-oriented software systems
b) A diagram used to model procedural software systems
c) A diagram used to model functional software systems
d) None of the above
Answer: a) A diagram used to model object-oriented software systems
14. What is a use case diagram?
a) A diagram used to model the interactions between users and the system
b) A diagram used to model the classes and their relationships in the system
c) A diagram used to model the flow of activities in the system
d) None of the above
Answer: a) A diagram used to model the interactions between users and the system
15. What is a class diagram?
a) A diagram used to model the interactions between users and the system
b) A diagram used to model the classes and their relationships in the system
c) A diagram used to model the flow of activities in the system
d) None of the above
Answer: b) A diagram used to model the classes and their relationships in the system
16. What is a sequence diagram?
a) A diagram used to model the interactions between users and the system
b) A diagram used to model the classes and their relationships in the system
c) A diagram used to model the flow of activities in the system
d) None of the above
Answer: a) A diagram used to model the interactions between users and the system
17. What is an activity diagram?
a) A diagram used to model the interactions between users and the system
b) A diagram used to model the classes and their relationships in the system
c) A diagram used to model the flow of activities in the system
d) None
Answer: c) A diagram used to model the flow of activities in the system
18. What is abstraction?
a) The process of creating new objects from existing objects
b) The process of creating new classes from existing classes
c) The process of representing essential features of an object without including unnecessary
details
d) None of the above
Answer: c) The process of representing essential features of an object without including
unnecessary details
19. What is a destructor?
a) A method used to create objects
b) A method used to destroy objects
c) A method used to modify objects
d) None of the above
Answer: b) A method used to destroy objects
20. What is a static method?
a) A method that can be called without creating an object of the class
b) A method that can be called only by objects of the class
c) A method that is used to modify objects
d) None of the above
Answer: a) A method that can be called without creating an object of the class
21. What is a static variable?
a) A variable that can be accessed only by objects of the class
b) A variable that is used to modify objects
c) A variable that is shared by all instances of the class
d) None of the above
Answer: c) A variable that is shared by all instances of the class
22. What is a final variable?
a) A variable that can be modified after it has been initialized
b) A variable that cannot be modified after it has been initialized
c) A variable that is used to modify objects
d) None of the above
Answer: b) A variable that cannot be modified after it has been initialized
23. What is an abstract class?
a) A class that cannot be instantiated
b) A class that can be instantiated
c) A class that is used to modify objects
d) None of the above
Answer: a) A class that cannot be instantiated
24. What is an interface?
a) A class that cannot be instantiated
b) A class that provides a common interface for other classes
c) A class that is used to modify objects
d) None of the above
Answer: b) A class that provides a common interface for other classes
25. What is a package?
a) A collection of classes and interfaces
b) A collection of variables and methods
c) A collection of objects
d) None of the above
Answer: a) A collection of classes and interfaces
26. What is a use case?
a) A diagram used to model the flow of activities in the system
b) A diagram used to model the interactions between actors and the system
c) A diagram used to model the relationships between classes
d) None of the above
Answer: b) A diagram used to model the interactions between actors and the system
27. What is an actor in a use case diagram?
a) A class that interacts with the system
b) A person, organization, or system that interacts with the system
c) A method that interacts with the system
d) None of the above
Answer: b) A person, organization, or system that interacts with the system
28. What is an association in a class diagram?
a) A relationship between classes
b) A relationship between objects
c) A relationship between methods
d) None of the above
Answer: a) A relationship between classes
29. What is a multiplicity in an association?
a) The number of objects that can be involved in the relationship
b) The type of relationship between objects
c) The type of relationship between classes
d) None of the above
Answer: a) The number of objects that can be involved in the relationship
30. What is aggregation in a class diagram?
a) A type of association that represents a “whole-part” relationship
b) A type of association that represents an “is-a” relationship
c) A type of relationship between objects
d) None of the above
Answer: a) A type of association that represents a “whole-part” relationship
31. What is composition in a class diagram?
a) A type of association that represents a “whole-part” relationship where the parts cannot exist
independently of the whole
b) A type of association that represents an “is-a” relationship
c) A type of relationship between objects
d) None of the above
Answer: a) A type of association that represents a “whole-part” relationship where the parts
cannot exist independently of the whole
32. What is inheritance in a class diagram?
a) A mechanism for creating new classes from existing classes
b) A type of relationship between objects
c) A type of association that represents a “whole-part” relationship
d) None of the above
Answer: a) A mechanism for creating new classes from existing classes
33. Which of the following is not a fundamental design principle of object-oriented analysis and
design?
a) Encapsulation
b) Inheritance
c) Polymorphism
d) Iteration
Answer: d) Iteration
34. What is an object diagram?
a) A diagram that represents the interactions between actors and the system
b) A diagram that represents the relationships between classes
c) A diagram that represents the interactions between objects
d) None of the above
Answer: c) A diagram that represents the interactions between objects
35. What is a state machine diagram?
a) A diagram that represents the interactions between actors and the system
b) A diagram that represents the relationships between classes
c) A diagram that represents the different states of an object and the transitions between them
d) None of the above
Answer: c) A diagram that represents the different states of an object and the transitions between
them
36. What is a collaboration diagram?
a) A diagram that represents the interactions between actors and the system
b) A diagram that represents the relationships between classes
c) A diagram that represents the interactions between objects and their relationships
d) None of the above
Answer: c) A diagram that represents the interactions between objects and their relationships
37. What is coupling?
a) The degree to which two classes are related to each other
b) The degree to which two classes are independent of each other
c) The degree to which two classes share a common interface
d) None of the above
Answer: a) The degree to which two classes are related to each other
38. What is cohesion?
a) The degree to which two classes are related to each other
b) The degree to which the methods in a class are related to each other
c) The degree to which two classes share a common interface
d) None of the above
Answer: b) The degree to which the methods in a class are related to each other
39. Which design pattern is used to create objects without specifying the exact class to create?
a) Abstract Factory
b) Builder
c) Factory Method
d) Prototype
Answer: c) Factory Method
40. Which design pattern is used to encapsulate a group of individual factories?
a) Abstract Factory
b) Builder
c) Factory Method
d) Prototype
Answer: a) Abstract Factory
41. Which design pattern is used to separate the construction of a complex object from its
representation?
a) Abstract Factory
b) Builder
c) Factory Method
d) Prototype
Answer: b) Builder
42. Which design pattern is used to clone an existing object instead of creating a new one?
a) Abstract Factory
b) Builder
c) Factory Method
d) Prototype
Answer: d) Prototype
43. Which design pattern is used to decouple a sender and receiver of a request?
a) Chain of Responsibility
b) Command
c) Interpreter
d) Iterator
Answer: b) Command
44. Which design pattern is used to handle requests by chaining multiple objects together?
a) Chain of Responsibility
b) Command
c) Interpreter
d) Iterator
Answer: a) Chain of Responsibility
45. Which design pattern is used to represent a grammar of a language?
a) Chain of Responsibility
b) Command
c) Interpreter
d) Iterator
Answer: c) Interpreter