Geschrieben von Student*innen, die bestanden haben Sofort verfügbar nach Zahlung Online lesen oder als PDF Falsches Dokument? Kostenlos tauschen 4,6 TrustPilot
logo-home
Document preview thumbnail
Vorschau 3 aus 30 Seiten
Prüfung

SD 2 – Object-Oriented Programming

Document preview thumbnail
Vorschau 3 aus 30 Seiten

SD 2 – Object-Oriented Programming

Inhaltsvorschau

1. Which of the following is a feature of object-oriented programming?

A. Data is hidden

B. Data is manipulated directly

C. Functions are not used

D. Programs are written in a procedural way

Answer: A) Data is hidden

Rationale: One of the key features of OOP is data encapsulation, which means data

is hidden from outside access and can only be accessed through public methods.




2. What is the main purpose of inheritance in object-oriented programming?

A. To allow data encapsulation

B. To reuse code in derived classes

C. To hide data

D. To implement multiple threads

Answer: B) To reuse code in derived classes

,Rationale: Inheritance allows a class to inherit properties and behaviors (methods)

from another class, promoting code reuse.




3. Which of the following best describes a class in object-oriented programming?

A. A function that performs tasks

B. A template for creating objects

C. A variable used to store data

D. A process used to execute instructions

Answer: B) A template for creating objects

Rationale: A class defines the blueprint or template from which objects are

instantiated.




4. What does the term "polymorphism" in object-oriented programming refer to?

A. Objects take multiple forms

B. The ability to hide data

C. The reuse of code

D. The process of creating a new class from an existing class

Answer: A) Objects take multiple forms

, Rationale: Polymorphism allows objects to take on different forms, typically

through method overloading or method overriding.




5. Which of the following is an example of method overloading?

A. A method with the same name but different parameters

B. A method that changes its behavior based on the object type

C. A method that calls another method

D. A method that throws an exception

Answer: A) A method with the same name but different parameters

Rationale: Method overloading occurs when multiple methods with the same name

exist but with different parameter lists.




6. What is encapsulation in object-oriented programming?

A. The process of hiding data and only exposing necessary functionality

B. The process of creating new objects from a class

C. The ability of an object to take multiple forms

D. The inheritance of properties and methods from a parent class

Answer: A) The process of hiding data and only exposing necessary functionality

Dokument Information

Hochgeladen auf
17. märz 2025
Anzahl der Seiten
30
geschrieben in
2024/2025
Typ
Prüfung
Enthält
Fragen & antworten
$11.49

Falsches Dokument? Kostenlos tauschen Innerhalb von 14 Tagen nach dem Kauf und vor dem Herunterladen kannst du ein anderes Dokument wählen. Du kannst den Betrag einfach neu ausgeben.
Geschrieben von Student*innen, die bestanden haben
Sofort verfügbar nach Zahlung
Online lesen oder als PDF

Seller avatar
douglasmugwe82
5.0
(1)
Verkauft
2
Anhänger
0
Sachen
4239
Zuletzt verkauft
11 Jahren vor



Warum sich Studierende für Stuvia entscheiden

on Mitstudent*innen erstellt, durch Bewertungen verifiziert

Geschrieben von Student*innen, die bestanden haben und bewertet von anderen, die diese Studiendokumente verwendet haben.

Nicht zufrieden? Wähle ein anderes Dokument

Kein Problem! Du kannst direkt ein anderes Dokument wählen, das besser zu dem passt, was du suchst.

Bezahle wie du möchtest, fange sofort an zu lernen

Kein Abonnement, keine Verpflichtungen. Bezahle wie gewohnt per Kreditkarte oder Sofort und lade dein PDF-Dokument sofort herunter.

Student with book image

“Gekauft, heruntergeladen und bestanden. So einfach kann es sein.”

Alisha Student

Arbeitest du an deiner Quellenangabe?

Erstelle korrekte Quellenangaben in APA, MLA und Harvard mit unserem kostenlosen Zitiergenerator.

Arbeitest du an deiner Quellenangabe?

Häufig gestellte Fragen