Untitled spreadsheet - Sheet1 Flashcards
Fatal errors include simple errors in code that prevent compilation or errors that occur during run time.
T
Semantic errors are errors that cause applications to fail completely, such as simple error in code that prevent compilation.
F
CS allows you to build applications in what two configurations?
Debug & Release
Debug builds maintain symbolic information about your application.
T
How can you switch between the Debug and Release configurations in VS?
Using the Solution Configurations drop-down menu in the Standard toolbar.
In the release configuration application code is optimized. As a result Release builds will run much faster than Debug builds?
T
The process of identifying and fixing areas of code that don’t work as expected is known as what?
Debugging
What is the main advantage of using Release builds?
Release builds run faster
Debug.WriteLine() and Trace.WriteLine() only allow output of a single string?
T
There is one way to outpute debugging information?
F
An alternative to writing information to the output window is to use:
Debug.Write() & Trace.Write()
Tracepoints are a function of C#
F
Tracepoints serve the same function as using Debug.WriteLine(). They allow you to output debugging information without altering your code.
T
What does a tracepoint do?
Enabel youto output debugging information without modifying the code.
What does a tracepoint do?
Writes information to the output window.
Tracepoints have no equivalent to the trace commands. There is no way to output information in a Release build using tracepoints.
T
What is the disadvantage/advantage of tracepoints.
The tracepoint is stored in VS.
The simplest way to enter break mode is to click the Pause button in the IDE while an application is running
T
Trace commands are often the only option should you want output during execution of an application built in release mode.
T
What is a breakpoint?
A marker in the source code that triggers automatic entry into break mode.
When should you use a tracepoint?
When debugging an application to quickly output important information that may help resolve semantic errors.
While using debugging in Break Mode you can pause, stop, and restart the application?
T
A breakpoint appears as a blue circle next to the line of code.
F
Selecting Hit Count opens a dialog box where you can specify how many times a breakpoint needs to be hit before it is triggered. The drop down list enables what options?
Break always; hit count is =, %, >=
What are the two ways to get into break mode?
Enter break mode when an unhandled exception is thrown. Break when an assertion is generated.
What are assertions?
instructions that can interrupt application execution with a suer-defined message.
What is the easiest way to check the value of a variable?
Hover the mouse over its name in the source code while in break mode.
You can distribute release builds of your application containing Debug.Assert() functions to keep tabs on things.
F
It is not possible to pin tooltip windows to the code view.
F
Step into executes and moves to the next statement to execute.
T
What are the three ways to control program flow in break mode?
Step Into, Over, Out
What does Step Out do?
Runs to the end of the code block and resumes break mode at the statement that follows.
The Call Stack Window enables you to execute commands while an application is running.
F
The Command and Immediate windows enable you to execute commands while an application is running
T
What is the purpose of the Call Stack window?
Showing the current function along with the function that called it, and the one that called it, et cetera.
Which window shows you the way in which the program reached the current location?
Call Stack Window
An exception is an error generated either in your code or in a function called by your code that occurs before runtime
F
The C# language includes syntax for SHE. It stands for Stack Exception Handling.
F
What are the three key words mark code as being able to hand exceptions, along with instructions specifying what to do when an exception occurs?
Try, Catch, Finally
What does SEH stand for?
Structured Exception Handling
What is error handling?
All techniques of anticipating broblems and writing code that is robust enough to deal with the errors gracefully, without interrupting execution.
The “catch” in a try…catch…finally structure contains code that might throw exceptions.
T
You use the C# toss keyword to generate an exception.
F - Throw
You don’t always have to supply “catch” blocks for more specific exceptions before more general catching.
F
You must always supply catch blocks for more specific exceptions before more general catching, or the application will fail to compile.
T
Exceptions are errors that occur at runtime and that you can trap and process programmatically to prevent your application from terminating.
T
You can add breakpoints anywhere in your code and you can configure breakpoints to break execution only under specific conditions.
T
A class encapsulates part of the application, which can be a process, a chunk of data, or a more abstract entity.
F
Object-oriented programming is a relatively new approach to creating computer applications that seeks to address many of the problems with traditional programming techniques.
T
OOP techniques are firmly rooted in the structure and meaning of data, and the interaction between that data and other data.
T
The type of programming often resulting in monolilthic applications, meaning all functionality is contained in a few modules of code is known as (2 Possible Names):
functional programming / procedural programming
What is also known as procedural programming?
Functional programming
What is an object?
building block of an OOP application.
What is the difference between functional and object oriented programming?
Functional: all functionality is contained in a few modules of code (often just 1). OOP: More modules of code with each offering specific functionality.
What is a language designed and used for modeling applications
Unified Modeling Language
Class definitions may not be used to instantiate objects
F
Object and instance of a class mean refer to the same thing?
T
What does instantiate mean when referring to objects in OOP?
Creating a real, named instance of a class.
What does the properties and fields provide?
Access to the data contained in an object.
What is the term used to refer to functions exposed by objects
Method
As well as this read/write access for properties, you can also specify a different sort of access permission for both fields and properties, known as accessibility.
T
Each field and property in OOP specifies accessibility, member name, and member type.
T
In general, it is better to provide properties rather than fields for state access because you have more control over various behaviors.
T
Methods are called in a way that is unique when compared to the calling of other functions
F
Public members are said to be exposed by the class.
T
What is a method?
Functions exposed by objets.
What is accessability?
The ability to specify the type of access permission for both fields and properties.
What is the main purpose of methods?
Provide access to the object’s functionality.
Everything in C# and the .NET Framework is an object.
T
How many parameters are in the default constructor?
None.
Nondefault constructors are constructors that include starting parameters.
T?
The life cycle of an object includes two important stages, these are known as:
Construction and Destruction
When an object is destroyed. There are often some clean-up tasks to perform such as freeing memory. This is the job of a deconstructor function.
T
When an object is first instantiated it needs to be initialized. This initialization is known as construction and is carried out by a constructor function, often referred to simply as a constructor for convenience.
T
Classes with no public constructors are noncreatable.
T
Destructors are used by the .NET Framework to clean up after objects.
T
In general, you don’t have to provide code for a constructor method; instead, the default operation does the work for you.
T
Noncreatable classes have no public constructor.
T
Static fields are also known as shared fields.
T
Static members are shared between instances of a class.
T
A class can have a single static constructor, which must have no access modifiers and cannot have any parameters.
T
A static constructor can never be called directly.
T
An what is a collection of public instance methods and properties that are grouped together to encapsulate specific functionality.
Interface
An interface is a collection of public instance methods and properties.
T
Interfaces can exist on their own.
F
Interfaces cannot contain any code that implements its members.
T
Rather than make constructors of a class private one strategy is to use a static class.
T
What does a static class do?
Allows you to use classes that contain only static members and cannot be used to instantiate objects.
What is an interface?
A collection of public instance methods and properties that are grouped together to encapsulate specific functionality.
Classes can support multiple interfaces, and multiple classes can can support the interface.
T
Interfaces implements on objects in UML are shown using lollipop syntax.
T
What is the purpose of Disposable Objects?
It is used to free up any critical resources that might otherwise linger until the destructor method is called on garbage collection.
A protected type of accessibility only derived classes have access to a member.
T
Although inheritance is an important feature of OOP, it does not enable you to extend or create more specific classes from a base class
F
In OOP terminology, the class being inherited from is the parent class
T
What does inheritance mean in OOP?
a class will have all the members of the class from which it inherits.
What does it mean for a base class to be virtual?
The member can be overridden by the class that inherits it.
What is inheritance
It will have all the members of the class from which it inherits.
What cannot be used as a base class?
An abstract case.
What is a useful technique for performing tasks with a minimum of code on different objects descending from a single class.
Polymorphism
All classes in C# derive from the base class object at the root of their inheritance hierarchies
T
What is polymorphism?
A way to perform tasks with minimum code on different objects descending from a single class.
What is simple to achieve by using a member field to hold an object instance
Containment
Collections are simple to achieve by using a member field to hold an object instance.
F
Interface polymorphism is a way to have a variable of an interface type.
T
What is the difference between containment and inheritance?
Containment is similar to inheritance but allows the containing class to control access to members of the caintained class. Collections is similar to arrays of objects, but collactions have additional functionality.
What is the main purpose of interface polymorphism?
To have a variable of an interface
What is a collection in OOP?
A collection is basically a module with bells and whistles, and is implements as classes in much the same way as other objects.
What is basically an array with bells and whistles?
Collection
What are important occurrences that you can act on in other parts of code, similar to exceptions.
Events
Events are occurrences that can act on in other prats of code.
T
Every class you create will be a value type.
T
One key difference between value types and reference types is that value types always contain a value, whereas reference types can be null, reflecting the fact that they contain no value.
T
Strings, objects, and arrays are examples of reference types.
T
Value types store themselves and their content in multiple places in memory
F
What does it mean for an operator to be overloaded?
An operator for which you have written the code to perform the operation involved, the code is added to the class definitoinn of one of the classes that it operates on.
What is one key difference between value types and reference types.
Reference types can be null.
What is one key difference between value types and reference types.
Value types always contain a value, whereas reference types can be null.
All objects instantiated from a derived class can be treated as if they were instances of a parent class
T
Inheritance is the mechanism through which one class definition can derive from another.
T
Static members are available only on object instances of a class.
F
What are a collection of public properties and methods that can be implemented on a class.
Static members
What is an interface?
A collection of public properties and methods that can be implemented on a class.