Object-Oriented Programming: Key Concepts Q&A, Exams of Medicine

Explore fundamental concepts of object-oriented programming (oop) through a series of questions and answers. Key topics such as abstraction, apis, classes, inheritance, polymorphism, encapsulation, and more. It provides clear explanations and examples to help understand the core principles of oop, making it a valuable resource for students and developers alike. Each concept is explained with practical examples, enhancing comprehension and application in real-world scenarios. This guide is designed to clarify complex topics and improve your understanding of oop.

Typology: Exams

2024/2025

Available from 10/19/2025

Ted.Bright
Ted.Bright 🇺🇸

5

(1)

7.3K documents

1 / 8

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Object Oriented Programming Questions Updated Actual And
Answers
1.
Abstraction
When complex processes are hidden from the user who gets a simple interface to
use to make something work. This is done in code when a program user can click
buttons to make a game work but they have no idea what is going on behind those
buttons in the class files of code. It's like a car that a user just needs a key for to
turn the engine over and run it. The hood hides all the complex machinery. The
key ignition is the abstraction to allow a person to use the car.
2.
API
A pre-written library or set of objects and their properties and processes that
you can make use of in writing programs. It is provided in most programming
languages so you can build more complex applications without having to create
everything from scratch.
3.
Argument
Information that's passed into a method/function. In Java, C#, JavaScript, and
similar languages, arguments are placed inside the parentheses when calling the
function. Arguments are also sometimes called parameters.
4.
Class
The blueprint for creating instances of an object. It contains all the methods and
properties that an object will be able to work with when it is constructed. It is
invoked using the "new" keyword.
pf3
pf4
pf5
pf8

Partial preview of the text

Download Object-Oriented Programming: Key Concepts Q&A and more Exams Medicine in PDF only on Docsity!

Object Oriented Programming Questions Updated Actual And

Answers

  1. Abstraction When complex processes are hidden from the user who gets a simple interface to use to make something work. This is done in code when a program user can click buttons to make a game work but they have no idea what is going on behind those buttons in the class files of code. It's like a car that a user just needs a key for to turn the engine over and run it. The hood hides all the complex machinery. The key ignition is the abstraction to allow a person to use the car.
  2. API A pre-written library or set of objects and their properties and processes that you can make use of in writing programs. It is provided in most programming languages so you can build more complex applications without having to create everything from scratch.
  3. Argument Information that's passed into a method/function. In Java, C#, JavaScript, and similar languages, arguments are placed inside the parentheses when calling the function. Arguments are also sometimes called parameters.
  4. Class The blueprint for creating instances of an object. It contains all the methods and properties that an object will be able to work with when it is constructed. It is invoked using the "new" keyword.
  1. Base Class This is the object type or blueprint that can be used as a starting point for objects that will include the base class properties and processes but that will add more to a new object. For example, a Plane object could be used as a base for a flghterPlane object. FighterPlane is a more advanced, more detailed version of Plane. The base class is the class that is used as a foundation for a more extensive, specialized type. A general WaterBot is a base class for a specialized SquidBot. The WaterBot is the base class (also called a superclass) and the SquidBot is the sub-class (also called derived class).
  2. Sub Class *Sub-class When a class is extended from a another class. The sub-class will use the functionality and properties of the class it extends from and then build more specific properties and methods it can do from there. A sub-class inherits all the abilities and properties or attributes from the class it inherits from. A FighterPlane is a sub-class of a Plane object. Rectangle is a sub-class of a Shape class. This is also called a derived class or a child class.
  3. Inheritance When an object gets some of its properties and processes from a more basic Object constructor. A FighterPlane object inherits the properties and processes of a Plane object.
  1. Instance A copy of an object when the constructor creates one. It's not the blueprint of how to create the object. It's a COPY of the object. It's the virtual object created when memory space is devoted on a disk to hold the properties and methods contained in its blueprint/class.
  2. Extend When a base class or object constructor is used as a starting point for creating a new, more advanced, version of an object. A plane class can be extended to create a FighterPlane class.
  3. Polymorphism When an object that has been extended from another base object is both an in- stance of the base object AND the newly defined, more advanced Object. Example: an object could be a FighterPlane AND a Plane at the same time because the FighterPlane Object extends the Plane object. It has everything the Plane class has and more. A CorvetteCar is also a BasicCar. A SkyscraperBuilding is also a BasicBuilding.
  4. Composition When an object is made up of a group of other objects. For example, an astronaut Suit object could include a Helmet, Glove, Boot and other objects to make a full Suit object. This gives additional properties and functionality to the Suit object than it would have by itself. This is different than getting additional properties and functionality from inheritance.
  1. Properties ("has a" items)
  2. Processes ("can do" items) These are the things an object has or can be described by. This can be thought of in the form of nouns. They can sometimes be referred to as variables, attributes, data, characteristics, or traits. Things an object can do. They can be thought of in the form of verbs. These are also called "behaviors", in fact, Dreamweaver calls Javascript functions "behaviors". Sometimes they are called "operations".
  3. Encapsulation The idea of keeping a section of a program sectioned off to itself so all the other sections of the program don't intermix with it. It can be used to refer to modularity. This is done when you have different modules of code like a type of bot that can be used by the rest of the program but that only when one has been created and only by making used of the methods it has in it to do anything. The term encapsulation is often used interchangeably with information hiding. You might consider information hiding as being the principle and encapsulation being the technique.
  4. Cast
  1. Instantiation The process of creating an instance of some class object using the "new" keyword and the class constructor method. It creates a new copy of an object and gives a value or values to all the needed properties Within the class for that copy.
  2. Modular A section of a program is sectioned off to itself and other sections that need to use it can do so without needing access to all the details of the internal code to the module. It keeps all the code for particular features together as much as possible without being dispersed all throughout a program. Example: the capability to allow a photon shooter to fire can be contained into a few functions and accessed through a single button or keystroke; the section doing the actual firing is contained in one section or area.
  3. Object State The values of all an instance of an object's properties at any given time. If you have an instance of a Tank object and display all the property values of it to the screen at a given time you are outputting that instance of the Tank object's state to the screen.
  4. Members The properties and methods that belong to a class.