Study your flashcards anywhere!

Download the official Cram app for free >

  • 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

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

A key: Read text to speech.a key


Play button


Play button




Click to flip

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?
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
concatenates array of string parameters
inserts join character between string parameters
uses a C style formating
mutable strings
StringBuilder memory management
starts with 16byte, grows as needed
String +
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 ) ;
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
event interrupting normal execution
what must you do with exceptions
catch them so application doesn't stop completely
what do .Net exceptions derive from?
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
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
text describing exception
includes file and line number causing exception
what should you do with Exception.StackTrace
log it to log file