Abstract Data Types and Encapsulation Concepts

0.0(0)
studied byStudied by 0 people
0.0(0)
full-widthCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/26

flashcard set

Earn XP

Description and Tags

Flashcards reviewing abstract data types, encapsulation concepts, and their implementation in various programming languages.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

27 Terms

1
New cards

What is an abstraction?

A view or representation of an entity that includes only the most significant attributes.

2
New cards

What is an abstract data type?

User-defined data type where object representation is hidden, and type/operation declarations are in a single syntactic unit.

3
New cards

What are the advantages of hiding data representations in ADTs?

Reliability, reduces code range, less name conflicts.

4
New cards

What are the advantages of having type and operation declarations in a single unit in ADTs?

Program organization, aids modifiability, separate compilation.

5
New cards

What are the language requirements for ADTs?

A syntactic unit for type definition, method to make names visible while hiding definitions, and some built-in primitive operations.

6
New cards

What are the key design issues for ADTs?

Can abstract types be parameterized, what access controls are provided, is the specification separate from the implementation?

7
New cards

In C++, what are the purpose of private, public, and protected clauses?

Private: hidden entities. Public: interface entities. Protected: inheritance.

8
New cards

What are constructors in C++?

Functions to initialize data members of instances.

9
New cards

What are destructors in C++?

Functions to clean up after an instance is destroyed, usually to reclaim heap storage.

10
New cards

Why are friend functions or classes necessary in C++?

To provide access to private members to unrelated units or functions.

11
New cards

How does Java differ from C++ in its data abstraction implementation?

All user-defined types are classes, objects are heap allocated with reference variables, implicit garbage collection, package scope.

12
New cards

What access modifiers does C# add beyond those in C++ and Java?

Internal and protected internal.

13
New cards

What are structs in C#?

Lightweight classes that do not support inheritance.

14
New cards

What is a common solution for needing access to data members in C#?

Accessor methods (getter and setter).

15
New cards

What are properties in C#?

Way of implementing getters and setters without explicit method calls.

16
New cards

What is a Parameterized Abstract Data Type?

ADT that can store any type elements.

17
New cards

How are Parameterized ADTs implemented in C++?

Classes can be somewhat generic by writing parameterized constructor functions.

18
New cards

How are Parameterized Classes implemented in Java 5.0?

Generic parameters must be classes; common types are collection types.

19
New cards

What is encapsulation?

A grouping of subprograms that are logically related into a unit that can be separately compiled.

20
New cards

What are Nested Subprograms?

Organizing programs by nesting subprogram definitions inside larger subprograms.

21
New cards

How is encapsulation implemented in C?

Files with subprograms independently compiled, interface in a header file.

22
New cards

How is encapsulation implemented in C++?

Classes and Friend functions

23
New cards

What are C# Assemblies?

A collection of files appearing as a single dynamic link library or executable.

24
New cards

What is a naming encapsulation?

Used to create a new scope for names.

25
New cards

How are Naming Encapsulations implemented in C++?

Place each library in its own namespace; qualify names used outside with the namespace.

26
New cards

How are Naming Encapsulations implemented in Java Packages?

Clients can use fully qualified name or use the import declaration

27
New cards

How are Naming Encapsulations implemented in Ruby Modules?

Ruby classes are name encapsulations; modules encapsulate constants and methods.