Docsity

Object-Oriented Programming (OOP) Concepts: Q&A for Java, Exams of Medicine

Toggle sidebar
bg1
Object-Oriented Programming [Java] Updated
actual questions and answers
Three Fundamental Features of OOP - CORRECT ANSWER✅✅Encapsulation
Inheritance
Polymorphism
Encapsulation - CORRECT ANSWER✅✅An object-oriented technique in which
the internal details of an object are "hidden" in order to simplify their use and
reuse.
Inheritance - CORRECT ANSWER✅✅A relationship between two classes in
which one class ( the subclass) inherits all of the properties and capabilities of
another ( the superclass)
Polymorphism - CORRECT ANSWER✅✅Declaring a variable to have one type
while it refers to an object of a subclass of that type.
Object-Oriented Analysis - CORRECT ANSWER✅✅A means of determining what
aspects of a given problem can be viewed as objects in an eventual object-
oriented design.
Object-Oriented Design - CORRECT ANSWER✅✅A software design method that
models the characteristics of abstract or real objects using classes and objects.
pf3
pf4
pf5

Partial preview of the text

Download Object-Oriented Programming (OOP) Concepts: Q&A for Java and more Exams Medicine in PDF only on Docsity!

Object-Oriented Programming [Java] Updated

actual questions and answers

Three Fundamental Features of OOP - CORRECT ANSWER✅✅Encapsulation Inheritance Polymorphism Encapsulation - CORRECT ANSWER✅✅An object-oriented technique in which the internal details of an object are "hidden" in order to simplify their use and reuse. Inheritance - CORRECT ANSWER✅✅A relationship between two classes in which one class ( the subclass) inherits all of the properties and capabilities of another ( the superclass) Polymorphism - CORRECT ANSWER✅✅Declaring a variable to have one type while it refers to an object of a subclass of that type. Object-Oriented Analysis - CORRECT ANSWER✅✅A means of determining what aspects of a given problem can be viewed as objects in an eventual object- oriented design. Object-Oriented Design - CORRECT ANSWER✅✅A software design method that models the characteristics of abstract or real objects using classes and objects.

Object-Oriented Programming - CORRECT ANSWER✅✅A programming technique that features objects, classes, encapsulation, interfaces, polymorphism, and inheritance. Cohesion - CORRECT ANSWER✅✅Degree to which responsibilities of a given component are a meaningful unit Cohesion vs Coupling - CORRECT ANSWER✅✅Greater cohesion reflects better design. Less coupling reflects better design. Coupling - CORRECT ANSWER✅✅Degree to which one component must directly access the data of another component. Roles - CORRECT ANSWER✅✅Sets of Responsibilities Roles vs. Objects - CORRECT ANSWER✅✅They are the same when a given role is always played by the same object type. Software Components - CORRECT ANSWER✅✅Reuse of code (e.g. Visual Basic, JavaBean) Frameworks - CORRECT ANSWER✅✅Reuse of "plug-in" code (e.g. Java Swing) Design Paterns - CORRECT ANSWER✅✅Reuse of Design

Liskov Substitution Principle - CORRECT ANSWER✅✅Determine whether a subclass is a subtype Protected Access - CORRECT ANSWER✅✅No outside classes can use this data field, except descendant classes. Defeats the purpose of OOP. Upcasting - CORRECT ANSWER✅✅Type cast to the type of an ancestor class. Is usually done automatically. Downcasting - CORRECT ANSWER✅✅Type cast to the type of a descendant class; may cause runtime errors. Interfaces - CORRECT ANSWER✅✅A purely abstract class. Can only contain constants and method signatures. Marker Interface - CORRECT ANSWER✅✅An interface with no methods or fields Use Case Diagram - CORRECT ANSWER✅✅UML diagram that captures all actors (an individual or another system) and use cases involved with a system or product. Used to model user requirements. Use Case - CORRECT ANSWER✅✅Functional requirement of a system as a sequence of steps.

Generalization (Base Use Case) - CORRECT ANSWER✅✅A way to indicate that a given use case is a variation of, or specific version of, another use case. [Closed Unfilled Arrow] Extension - CORRECT ANSWER✅✅A way to indicate limited ways a use case can vary (e.g. Delete Message, current or all?) <> Includes - CORRECT ANSWER✅✅A way to indicate steps that occur in more than one scenario. (e.g. Validate Pin)<> Associated Scenario - CORRECT ANSWER✅✅The detailed steps of a use case. Class Diagram - CORRECT ANSWER✅✅A visual representation of the relationships between classes. Composition - CORRECT ANSWER✅✅Represents real-world whole-part relationships, e.g., an engine is a part of a car Aggregation - CORRECT ANSWER✅✅Represents a class as a collection or container of other classes. Dependency - CORRECT ANSWER✅✅Used to show that some UML element or a set of elements requires, needs or depends on other model elements for specification or implementation Multiplicity - CORRECT ANSWER✅✅Minimum and maximum number of occurrences of one object for a single occurrence of related object

End product is a conceptual model 5 Design Principles - CORRECT ANSWER✅✅1) Major subsystems should be loosely coupled, allowing independence

  1. Many-to-many relationships require an additional class
  2. Avoid exposing details of business logic implementation to the user interface
  3. Avoid exporting mutable objects
  4. Avoid importing objects of an internal type in the system Law of Demeter - CORRECT ANSWER✅✅"Single Dot Rule" Long lists of method calls are attributed to bad design