- Shuffle
Toggle OnToggle Off
- Alphabetize
Toggle OnToggle Off
- Front First
Toggle OnToggle Off
- Both Sides
Toggle OnToggle Off
Front
How to study your flashcards.
Right/Left arrow keys: Navigate between flashcards.right arrow keyleft arrow key
Up/Down arrow keys: Flip the card between the front and back.down keyup key
H key: Show hint (3rd side).h key
![]()
PLAY BUTTON
![]()
PLAY BUTTON
![]()
39 Cards in this Set
- Front
- Back
|
reference type
|
pointer on stack, data on heap
|
|
garbage collection
|
removes unreference objects
|
|
how to trigger garbage collection?
|
GC.Collect
|
|
type of apps garbage collection optimized for?
|
mostly short-lived objects, except root objects
|
|
copying reference types
|
copies the pointer
|
|
three common ref types
|
String, StringBuilder, Array
|
|
what's special about a string?
|
it's immutable
|
|
how do you avoid creating too many temporary strings when adding to a string
|
use Concat, Join, or Format or use StringBuilder
|
|
String.Concat
|
concatenates array of string parameters
|
|
String.Join
|
inserts join character between string parameters
|
|
String.Format
|
uses a C style formating
|
|
StringBuilder
|
mutable strings
|
|
StringBuilder memory management
|
starts with 16byte, grows as needed
|
|
String +
|
concatenates
|
|
String =
|
creates a new string and copies
|
|
string == !=
|
compares the content of string
|
|
how do you declare array
|
square braces: int[]
|
|
how do you sort an array
|
Array .Sort ( theArray ) ;
|
|
stream
|
means to read/write to disk or network
|
|
namespace for task-specific streams
|
IO .Stream
|
|
namespace for network streams
|
Network .Sockets
|
|
namespace for encrypted streams
|
Security .Cryptography
|
|
what classes can you use to read/write to file
|
StreamReader, StreamWriter
|
|
how do you tell StreamReader or StreamWriter what file to work with
|
pass file name to constructor
|
|
what must you do to a stream after your done with it
|
Close, so it releases its lock on the resource
|
|
exception
|
event interrupting normal execution
|
|
what must you do with exceptions
|
catch them so application doesn't stop completely
|
|
what do .Net exceptions derive from?
|
SystemException
|
|
how do you define your own exception
|
extend ApplicationException
|
|
why would you want multiple exception classes?
|
to respond to different events differently
|
|
how does runtime decide which catch clause to execute in a series of catch clauses
|
first matching is executed only
|
|
"filtering exceptions"
|
ordering from most to least specific
|
|
finally
|
executes after try or catch
|
|
why use finally
|
clean up/close open objects
|
|
rule of thumb for try/catch clauses
|
must enclose all code except declarations
|
|
what happens to exceptions that have no catch clause associated with them
|
passed to caller, if still unhandled stop application
|
|
Exception.Message
|
text describing exception
|
|
Exception.StackTrace
|
includes file and line number causing exception
|
|
what should you do with Exception.StackTrace
|
log it to log file
|