Geschreven door studenten die geslaagd zijn Direct beschikbaar na je betaling Online lezen of als PDF Verkeerd document? Gratis ruilen 4,6 TrustPilot
logo-home
Document preview thumbnail
Voorbeeld 2 van de 5 pagina's
Tentamen (uitwerkingen)

Object Oriented Programming Test 2 UPDATED ACTUAL Exam Questions and CORRECT Answers

Document preview thumbnail
Voorbeeld 2 van de 5 pagina's

Object Oriented Programming Test 2 UPDATED ACTUAL Exam Questions and CORRECT Answers operator overloading - CORRECT ANSWER - AKA ad hoc polymorphism, a specific case where different operators have different implementations depending on their arguments . An example is the + operator which can be used in addition and string concatenation method overloading - CORRECT ANSWER - ability to create multiple methods of the same name with different parameters. The add method is a good example of this, the implicit parameters determine which way the method is called/used. COMPILE TIME

Voorbeeld van de inhoud

Object Oriented Programming Test 2
UPDATED ACTUAL Exam Questions and
CORRECT Answers
operator overloading - CORRECT ANSWER - AKA ad hoc polymorphism, a specific case
where different operators have different implementations depending on their arguments . An
example is the + operator which can be used in addition and string concatenation


method overloading - CORRECT ANSWER - ability to create multiple methods of the
same name with different parameters. The add method is a good example of this, the implicit
parameters determine which way the method is called/used. COMPILE TIME


method override - CORRECT ANSWER - have the exact same method name, return type,
number of parameters, and types of parameters as the method in the parent class, and the only
difference would be the definition of the method. RUN TIME


programming by contract - CORRECT ANSWER - aka design by contract "no suprises"
Metaphor for Business Contract


It is a software design approach that uses preconditions, postconditions and invariants.


check input parameters
check data structures/object after method call


law of demeter - CORRECT ANSWER - methods should not operate on global objects
that are part of another object
A design guideline that states that a method should not operate on global objects or objects that
are a part of another object


Method should only use...

, -instance fields of it's own class
-parameters
-objects that it constructs.


design by contract - CORRECT ANSWER - different groups of software programmers
agree to contract detailing how their software each groups should be able to write code without
knowing internals of other programmers code.


encapsulation - CORRECT ANSWER - hiding the details of an object from the other parts
of the program. The object can be used only through its access methods, which are carefully
written to keep the object consistent and secure. Encapsulation makes objects look like a black
box: the insides of the box are hidden from view. Controls are on the outside of the box. The user
can change the operation of the box only by using the controls.


accessor - CORRECT ANSWER - any method that returns info about an object should not
affect the state of that object


mutator - CORRECT ANSWER - any method that changes the state of the object


you typically want to avoid mutators, because of the side effects.


side effect - CORRECT ANSWER - an effect of a method that results in data modification
when the method is called a side effect is where you change some value that is not scoped
directly to just the method, but outside the method and you alter some value to some
class/variable outside the method. Therefore any other method, class, or variable cannot assume
that the value outside the method scope is going to be the same.


Quality of an interface - the "five Cs" - CORRECT ANSWER - Cohesion
Completeness
Convenience
Clarity

Documentinformatie

Geüpload op
17 april 2025
Aantal pagina's
5
Geschreven in
2024/2025
Type
Tentamen (uitwerkingen)
Bevat
Vragen en antwoorden
$12.49

Verkeerd document? Gratis ruilen Binnen 14 dagen na aankoop en voor het downloaden kan je een ander document kiezen. Je kan het bedrag gewoon opnieuw besteden.
Geschreven door studenten die geslaagd zijn
Direct beschikbaar na je betaling
Online lezen of als PDF

Seller avatar
De reputatie van een verkoper is gebaseerd op het aantal documenten dat iemand tegen betaling verkocht heeft en de beoordelingen die voor die items ontvangen zijn. Er zijn drie niveau’s te onderscheiden: brons, zilver en goud. Hoe beter de reputatie, hoe meer de kwaliteit van zijn of haar werk te vertrouwen is.
STANFORDGRADESS
4.0
(238)
Verkocht
1590
Volgers
108
Items
115164
Laatst verkocht
9 uur geleden




Waarom studenten kiezen voor Stuvia

Gemaakt door medestudenten, geverifieerd door reviews

Kwaliteit die je kunt vertrouwen: geschreven door studenten die slaagden en beoordeeld door anderen die dit document gebruikten.

Niet tevreden? Kies een ander document

Geen zorgen! Je kunt voor hetzelfde geld direct een ander document kiezen dat beter past bij wat je zoekt.

Betaal zoals je wilt, start meteen met leren

Geen abonnement, geen verplichtingen. Betaal zoals je gewend bent via Bancontact, iDeal of creditcard en download je PDF-document meteen.

Student with book image

“Gekocht, gedownload en geslaagd. Zo eenvoudig kan het zijn.”

Alisha Student

Bezig met je bronvermelding?

Maak nauwkeurige citaten in APA, MLA en Harvard met onze gratis bronnengenerator.

Bezig met je bronvermelding?

Veelgestelde vragen