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 1 out of 3 pages
Exam (elaborations)

CS 2114 Final Review questions with answers 2023

Document preview thumbnail
Preview 1 out of 3 pages

When does a class use composition? - When it has a data field that's an instance of another class Give an example of a "has a" relationship. - The Name class has an instance of the String class as a data field What is an adapter class? - Using composition to write a new class that has an instance of your existing class as a data field and defines the methods that you want Define inheritance - enables you to organize classes so that common properties and behaviors can be defined just once for all classes involved (is a relationship) True or False: Constructors are not inherited - True What happens when a data field is private in a superclass? - It's not accessible by name within the definition of a method for any other class, including a subclass What's a final method? - can't be overridden with a new definition in a subclass What's a final class? - you can't use it as a superclass to derive any other class from it (ex: string class) What's multiple inheritance? - when one class is derived from 2 different superclasses? Which one is legal? Student may = new CollegeStudent(); CollegeStudent may = new Student(); - Student may = new CollegeStudent(); (you go from general - specific) What does the clone method do? - takes no arguments and returns a copy of the receiving object What is a collection? - general term for an ADT, contains a group of objects What's an ADT bag? - unordered collection that allows duplicates (does not order contents) ADT list - numbers the items in the collection Do ADT stacks and queues order items? - Yes, they order them chronologically When you remove an item from a stack what gets removed? - the most recently added item When you remove an item from a queue, what gets removed? - the one that was added the earliest What's different about a sorted list? - determines where to place the item in the list (ex: alphabetical order)


Document information

Uploaded on
August 9, 2023
Number of pages
3
Written in
2023/2024
Type
Exam (elaborations)
Contains
Questions & answers
$10.89

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

Sold
1
Followers
1
Items
99
Last sold
2 year 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

Whoops! We can’t load your doc right now. Try again or contact support.