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
Document preview thumbnail
Preview 2 out of 12 pages
Exam (elaborations)

CS 151 EXAM QUESTIONS AND ANSWERS. VERIFIED 2025/2026.

Document preview thumbnail
Preview 2 out of 12 pages

CS 151 EXAM QUESTIONS AND ANSWERS. VERIFIED 2025/2026.

Content preview

CS 151 EXAM QUESTIONS AND
ANSWERS. VERIFIED 2025/2026.




The criteria for testing an app is its functional spec - ANS True



Superclass and subclass can declare attributes with the same name but thats a bad idea -
ANS True



Architectural design patterns are the second level of abstraction - ANS False



In Java Exception hierarchy, the subclasses of "Throwable" class are "Exception" and "Error:
classes - ANS True



Pick all that we get from obeying "Open-Closed Principle"



A) More efficient application

B) Decreasing the cost of app's maintenance

C) Higher possibility to cope with change and complexity

D) Increasing the complexity of the code - ANS B, C



What do we learn from "Interface Segregation Principle (ISP)" ?


1 @COPYRIGHT 2025/2026 ALLRIGHTS RESERVED.

, A) the role of segregation in inheritance

B) some inheritances are not polymorphic

C) the role of precondition in inheritance

D) interfaces should not be too big - ANS D



Class B inherits from class A, and both define their own preconditions.

If we want to use them in a polymorphic relationship, which of the following is correct?



A) Preconditions of class A must be either stronger than or equal to the preconditions of class B.

B) Preconditions of class A must be either weaker than or equal to the preconditions of class B.

C) Preconditions of class A must be equal to preconditions of class B.

D) Preconditions of class A must be weaker than preconditions of class B. - ANS A



Pick all true statements about "Singleton design pattern".



A) Only one instance of the class can exist.

B) It decreases dependency between classes.

C) None is correct.

D) This is a "creational" design pattern. - ANS A, D



What do we learn from "Liskov Substitution Principle (LSP)" ?



A) Interfaces should not be too big.

B) We should pick preconditions and postconditions carefully if we want to use an inheritance in
a polymorphic relationship.

2 @COPYRIGHT 2025/2026 ALLRIGHTS RESERVED.

Document information

Uploaded on
December 7, 2025
Number of pages
12
Written in
2025/2026
Type
Exam (elaborations)
Contains
Questions & answers
$12.99

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

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.
Brainbarter
3.6
(58)
Sold
363
Followers
159
Items
23019
Last sold
1 day ago



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