General Flashcards

You may prefer our related Brainscape-certified flashcards:
1
Q

What is a method vs. a function?

A

A function is a piece of code that is called by name. All information in a function is explicitly passed to it.

A method is a function that is associated with an object. In addition to whatever is passed to it, it can access members of that object.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is locality of reference?

A

It deals with the same storage locations being frequently accessed. Two main types: spatial and temporal.
Temporal: Once an address has been referenced, it is likely to be reference again soon. Think caching.
Spatial: Addresses near an address that was referenced might also be likely to be referenced. Think traversing an array.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Describe the differences between an Interface and an Abstract Class

A

An interface declares a set of related methods (an API) outside of any class. Very useful for languages without multiple-inheritence. It’s effectively an abstract class with no members or method definitions. Generally for unrelated classes that require the same set of methods.

An abstract class is an incomplete class definition that can declare methods and members, but does not define all of them. It can inherit from another class and be inherited. Generally for a set of classes that share an “is a” relationship with the base (abstract) class.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

API

A

Application Programming Interface

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Virtual Method

A
Allow a single method call to invoke different method definitions based on the class of the object (used in polymorphism).
Nonstatic Java methods are ALWAYS virtual. In C#, they're only virtual when they're DECLARED to be virtual.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Polymorphism

A

The capability to provide multiple implementations of an action and to select the correct implementation based on the surround context. (Overriding).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

When might you have an abstract class that implements an interface?

A

Maybe you want to give the option of default implementations to a class that implements the interface. It can inherit the abstract class and only implement one or two of the functions from the interface, since the rest may be defined in the abstract class.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Lazy Loading

A

Waiting until an object is needed before instantiating it.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What are properties in C#?

A

Treated like members, but with built-in accessor/mutator methods. Exposes getting and setting without exposing implementation / verification.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

ADO.NET vs OLEDB

A

Both are APIs to connect to databases.

ActiveX Data Objects DB works with MS-based dbs like SQL Server.

Object Linking and Embedding dbs is supported by many dbs, not just MS-based. OLE can also access MS-based dbs, but it’s not optimized for them like ADO.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Modular Programming

A

Separating the functionality of your code into modules that aren’t dependent on each other.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly