• Shuffle
    Toggle On
    Toggle Off
  • Alphabetize
    Toggle On
    Toggle Off
  • Front First
    Toggle On
    Toggle Off
  • Both Sides
    Toggle On
    Toggle Off
  • Read
    Toggle On
    Toggle Off
Reading...
Front

Card Range To Study

through

image

Play button

image

Play button

image

Progress

1/80

Click to flip

Use LEFT and RIGHT arrow keys to navigate between flashcards;

Use UP and DOWN arrow keys to flip the card;

H to show hint;

A reads text to speech;

80 Cards in this Set

  • Front
  • Back

What three properties do OOP languages generally include?

Encapsulation, Inheritance, Polymorphism

What is encapsulation and what are two reasons it is important?

To create a boundary around an object to seperate its external behavior from its private implementation. 1) ensures it is running how we want it to 2) prevents other from accessing the code and seeing how it works.

What is Inheritance?

Allowing objects to inherit from other objects.

What is Polymorphism?

The ability for an object to become other objects/other types.

What does a managed language require to execute.

A runtime environment, it is executed by a common runtime language.

What is the building block of OOP languages that stores metadata about space allocation?

A type.

What are the three categories of types?

Value types, Reference types, Pointer types.

What is the purpose of the unified type system (UTS)?

Identifies all the repetitive, universal types so they don't need to be created in every project.

Name two ways C# implements inheritance.

1)A class may inherit from a single base class, one and only one. 2)A class may implement zero or more interfaces.

What are Lambda expressions?

An unnamed method written inline. An enhancement of anonymous methods.

Define: Anonymous types. When are they commonly used?

Types without a design-time definition. Compiler inferred types. Used extensively with LINQ.

What is the downside of anonymous types?

They are not portable.

What do extension methods do? When are they useful?

Extend types without altering them. Useful for extending classes that are not yours or are sealed.

Define: Dynamics

Instruct the compiler to ignore type checking at compile time. Shuts down the security of the compiler. Ignores type checking until runtime.

A class represents a ________ type and a struct represents a _________ type.

reference, value.

Define: value type

directory stored values (int, boolean, double)

Define: Reference type

store a reference to data. Object instances, the value stored is a pointer to where the data is actually stored.

When are some common scenarios where you should use a struct?

1)Instances of the type are small


2)the struct is commonly embedded in another type


3)the struct logically represents a single value


4)the values don't change (immutable)


5)it is rarely boxed

What type is an object?

Reference type

A class duplicates an ________ of an __________, while not duplicating the __________ of an _________ itself.

instance, object, definition, object

What does the static keyword do to a class and why would it be used?

That class cannot be instantiated. Useful to expose static methods of that class so you can interact with them without the cost of instantiation.

What does the abstract keyword do to a class?

That class is incomplete, it must be completed in a derived class.

What does the sealed keyword do to a class?

That class cannot be inherited from.

What does the partial keyword do to a class?

Can be used to break up a class between multiple files. All properties will be compiled to one class at compile time.

What is Entity Framework?

An object-relational mapper that enables .NET devleopers to work with relational data using domain-specific objects. Eliminates the need for most of the data-access code to be manually written.

What does the public keyword do?

"Anyone can see this", a way around encapsulation.

What does the private keyword do?

Can only be used in the scope it is defined in.

What does the internal keyword do?

Can only be used in the scope of this assembly (project).

What does the protected keyword do?

Only scoped to this class and derived classes.

What does the get; set; instruction provide for us?

Instructs the compiler to create an infrastructure that will hold the value for the property defined.

What does the virtual keyword do?

Makes it so that this method can be overridden by inheriting classes.

If a method is overridden in an inheriting class and then cast back to the originating class, will the method remain overridden or return to the original value?

It will remain overridden.

What does the new keyword do?

Creates a brand new instance of the method, the original is not able to be referred to.

What are generics?

Introduce the concept of type parameters. Used when a strongly-typed collection is required.

Define: Boxing

The act of converting a value type to a reference type.

Define: Unboxing. What "action" does it require?

The act of converting a reference type to a value type. Unboxing requires a cast.

What are the three type of statements that control flow?

Selection, Iteration, Jump

What is a ternary statement?

an if statement shorthand

What is the difference between a while and a do while statement?

While evaluates the expression before executing the body so the body may execute 0 or more times.

What are the three clauses of for loops (in order)?

Initialization clause, conditional clause, iteration clause.

What does the foreach loop do?



Iterates over each element in an enumerable object.

What does the is operator do?

Returns true if an object is an instance of a type.


What does the as operator do?

Attempts to cast an object to a specified type.

What happens if you attempt to cast an object using 'as' but the operation fails?

The object is returned as null and no exception is raised.

A string is immutable. What does this mean specifically if we attempt to change the string?

A new string is returned.

What class is a mutable implementation of a string?

StringBuilder

Define: Regular Expressions

A specialized syntax to find and replace patterns in strings.

What is reflection and why is it useful?

Reflection inspects type metadata at runtime. This data can be used to create instances, access values, and execute methods dynamically at runtime.

What is a constructor?

A class method that is executed when an object of a given type is created.

Identify the constructor:


Animal a = new Animal();

Animal()

What is a finalizer? When are finalizers commonly used?

The inverse of a constructor. To release the resources created.

Name two pieces of information the type metadata contains.

1)The type name


2)The containing assembly


3)Constructors


4)Properties


5)Methods


6)Attributes

What are the two ways to dynamically instantiate a type?

1)Activator.CreateInstance


2)Calling Invoke on a ConstructorInfo object

What is Garbage Collection? What does it collect?

Automatic memory management. De-referenced objects (orphans).

What is the IDisposable interface used for?

Some objects need explicit code to release resources, IDisposable helps with that.

What keyword is a shortcut for invoking Dispose on types that implement IDisposable?

Using

How are close, dispose and stop related?

Close is functionally the same as Dispose but may be reopened. Stop is similar to close but can be restarted.

What are memory leaks and how are they created?

When objects that fall out of scope are referenced by objects in scope, keeping them alive.

The Garbage Collector will assume an object is eligible for collection if it is only referred to by ______ _____________.

Weak references


What is a code contract?

A system used for data validation.

Code contracts have preconditions and post-conditions. What are the keywords for these conditions?

Requires, ensures.

Describe symmetric vs asymmetric encryption.

Symmetric has only one key used for both encryption and decryption. Asymmetric has an outward facing public key and a private key used for decryption.

True or false: Assemblies can be referenced by other assemblies.

True

Assembly vs. Namespace: Which is a logical container of code and which is a physical container of code.

Assembly - physical


Namespace - logical

What VS project type creates an assembly that can be shared?

Class Libraries

Portable Class Libraries can be shared across _________, while Windows Component Libraries (WinMD/metadata) can be shared across ___________.

Platforms, languages.

What is a Windows Runtime Component?

A code library that can be used by all App Store development languages.

Define: instrumentation

Code that reports performance information.

Define: telemetry

Aggregating instrumentation for analysis.

What is the GAC and what does it do?

Global Assembly Cache. It creates a globally referenced set of assemblies on a machine.

What are the advantages of opening a file for reading and opening a file as stream.

reading - to keep open and keep writing.


stream - for large payloads and realtime processing.

What do Environment Special Folders help you quickly access?

Windows folders (documents, desktop, program files, etc)

What is isolated storage?

A data storage mechanism that provides isolation and safety by defining standardized ways of associating code with saved data.

What is the namespace that contains methods to rename/move files?

System.IO

What is the namespace that contains methods to get file info?

System.UI.FileInfo

What is SOAP?

Simple Object Access Protocol, standard for returning structured data from a Web Service as XML.

What is REST?

Representational State Transfer, a communications protocol. Uses less bandwidth than SOAP and typically returns XML or JSON.

____________ _____________ maximizes resources on multicore systems by allowing units of work to be separated and completed.

Asynchronous programming.

What are the two keywords that simplify asynchronous programming?

Async and await.

What is LINQ?

Language Integrated Query, a general-purpose query language that is integrated into .NET languages.