L. P. with Microsoft C# - Level 2-Quiz-1

  1. Class can be thought of as the template used to create objects at runtime.
  2. You are creating a method signature, and want to have it accept parameters that are passed in to it. Arguments is another name for these parameters specifically related to the signature.
  3. There are three basic ways you can pass arguments into a method.
    1. By value(defalut)
    2. By reference
    3. As output
  4. You are designing an application, and think you need to put a Main Method in one of your classes. When is a Main Method in a class?
    When it is intended to be the starting point for the application.
  5. Overloading is  called when you create multiple versions of the same method, with identical signatures, but which accept different numbers parameters or different types of parameters, or both.(the same name as current class)
  6. There is information that you want to physically store within the instance of a class.  I use Data Member to do this.
  7. There is a rule that says you have to have a break at the end of every case. When the case is empty is the only exception to this rule.
  8. You have a piece of code in which you want to return a string of characters to the console for the user to see. I use System.Console.WriteLine to do this.
  9. Reference type of variable stores a pointer to an instance of an object, rather than any actual data from the object.
  10. You want to create a reference to an object on the heap, but you do not know if it already has a reference pointing to it or not. What should you do?
    Do not worry about it, an object can have more than one reference.
  11. You have a Value type that you need to change to a reference type to make it work properly in your application. Boxing is the term for changing from a value type to a reference type.
  12. You are converting a reference type to a value type, and have gotten an InvalidCastException in the process. Why is this?
    The value of the object does not correspond to the value type you are trying to convert it into.
  13. You have taken an object with a numeric value of 32.17 and Unboxed it into an integer so that you could perform mathematical operations on it. An error will be thrown at runtime will happen.
  14. A Constructor can be overloaded, to give you different options on how you will be creating and instantiating classes. How are these different options distinguished from one another?
    The accept different numbers of parameters, or different types of parameters.
  15. A zero parameter Constructor is being called is assumed by the empty open and closed parenthesis () when it is found in the instantiation statement of the Main Method.
  16. Finalize is the name of the method that is referred to as the Destructor.
  17. You want to hide the inner workings of the class, limiting the visibility of the data members or other elements of the class that are used internally. This is called Encapsulation.
  18. There are two different ways you can encapsulate data. Accessor of these types typically uses the word "Get" in the name of its methods.
    1. Accessor/Mutator
    2. Property
  19. When you are using the Property form of Encapsulation, = (equals) is the operator used to pull a value out of a Property and assign it to something else.
  20. What do you need to do when you have encapsulated data with the name 'age' and a property with the name 'Age' to distinguish between the two?
    No additional distinction need be made, as C# is case sensitive.
  21. Even though the garbage collection process is automatic in C#, to avoid memory leaks, you should still Terminate your references when you are no longer using them.
Permalink | Comments (0) | Hits: 996 | Time: 11:49:23
Learning Programming with Microsoft C# - Level 2-1.10
Learning Programming with Microsoft C# - Level 2-2.1
All Comments

 No Data Now...

Post Your Comment
^ ^

Top