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
Reading...
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

A key: Read text to speech.a key

image

Play button

image

Play button

image

Progress

1/7

Click to flip

7 Cards in this Set

  • Front
  • Back
Explain when a type conversion will undergo an implicit cast and when you must perform an explicit cast. What are the dangers associated with explicit casts?
Types can be implicitly converted when the conversion can always take place without any potential loss of data. When a potential loss of data is possible, an explicit cast is required. If an explicit cast is improperly performed, a loss of data precision can result, or an exception can be thrown.
Explain why you might use enums and constants instead of their associated literal values.
Enums and constants make code easier to read and maintain by substituting human-legible tokens for frequently used constant values.
Briefly summarize the similarities and differences between arrays and collections.
Arrays and collections allow you to manage groups of objects. You can access a particular object by index in both arrays and collections, and you can use foreach syntax to iterate through the members of arrays and most collections. Arrays are fixed in length, and members must be initialized before use. Members of collections must be declared and initialized outside of the collection, and then added to the collection. Collections provided in the System.Collections namespace can grow or shrink dynamically, and items can be added or removed at run time.
Explain how properties differ from fields, Why would you expose public data through properties instead of fields?
Properties allow validation code to execute when values are accessed or changed. This allows you to impose some measure of control over when and how values are read or changed. Fields cannot perform validation when being read or set.
Explain what a delegate is and how one works.
A delegate acts like a strongly typed function pointer. Delegates can invoke the methods that they reference without making explicit calls to those methods.
Briefly explain how to convert a string representation of a number to a numeric type, such as an Integer or a Double.
All numeric data types have a Parse method that accepts a string parameter and returns the value represented by that string cast to the appropriate data type. You can use the Parse method of each data type to convert strings to that type.
What are the two kinds of multidimensional arrays? Briefly describe each.
Multidimensional arrays can be either rectangular arrays or jagged arrays. A rectangular array can be thought of as a table, where each row has the same number of columns. Rectangular arrays with more than two dimensions continue this concept, where each member of each dimension has the same number of members of each other dimension. Jagged arrays can be thought of as an array of arrays. A two-dimensional jagged array is like a table where each row might have a different number of columns.