Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 TrustPilot
logo-home
Exam (elaborations)

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

Rating
-
Sold
-
Pages
5
Grade
A+
Uploaded on
17-04-2025
Written in
2024/2025

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

Show more Read less
Institution
Object Oriented Programming
Course
Object Oriented Programming

Content preview

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

Written for

Institution
Object Oriented Programming
Course
Object Oriented Programming

Document information

Uploaded on
April 17, 2025
Number of pages
5
Written in
2024/2025
Type
Exam (elaborations)
Contains
Questions & answers

Subjects

$12.49
Get access to the full document:

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF


Also available in package deal

Thumbnail
Package deal
Object Oriented Programming Bundled Exam Questions WITH CORRECT Answers
-
20 2025
$ 49.41 More info

Get to know the seller

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
MGRADES Stanford University
View profile
Follow You need to be logged in order to follow users or courses
Sold
1455
Member since
2 year
Number of followers
105
Documents
97742
Last sold
2 hours ago
MGRADES

Welcome to MGRADES ,Based at Stanford University in California. I guarantee success and you may end up coming back again and again. We do this for you . We offer the best study and exam materials for a wide range of courses and units. Make your study sessions more efficient and effective. Dive in and discover all you need to excel in your academic journey!

3.8

235 reviews

5
97
4
50
3
53
2
15
1
20

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions