Flashcards
INSY 4306 Ch.10
Cards in this deck (38)
- 1A classes public methods are thepublic services or the public interface
- 2The access modifiers public and privatecontrol access to a classes variables, methods, and properties
- 3Public methodsPresent to the classes clients a view of the services the class provides
- 4Private VariablesNot directly accessible to the classes clients
- 5Every object can access a reference to itself with keywordthis
- 6You can use the this reference to refer tohidden instance variables explicitly
- 7Overloaded ConstructorsEnable objects of a class to be conveniently initialized in different ways
- 8To overload constructorsProvide multiple constructor declarations with different signatures
- 9Constructor Initializerspopular way to reuse initialization code provided by one of the classes constructors - reuse of constructors
- 10Every class must have at least oneconstructor
- 11If you do not provide any constructors in a class’s declarationthe compiler creates a default constructor that takes no arguments when it is invoked.
The compiler will not create a default constructor for a class that explicitly declares at least one constructor - 12If you have declared a constructor, but want to be able to invoke the constructor with no arguments, you must declarea paramaterless constructor
- 13has-a relationshipA class can have references to objects of other classes as members. This is called composition.
- 14Resource LeakIf all the references to the object that manages the resource are lost before the resources is explicitly released, it can no longer be released.
Other types of resource leaks can occur, for example if an app fails to close a file that it has opened. - 15Garbage Collectorused by the Common Language Runtime (CLR) to reclaim the memory occupied by objects that are no longer in use
- 16When there are no more references to an object, the object becomeseligible for destruction
- 17Every object has a ______ that's invoked by the garbage collector to perform ______ before its memory is reclaimeddestructor, termination housekeeping
- 18A destructor's name is theclass name, preceded by a title, and it has no access modifier in its header
- 19After an object's destructor is called, the object becomeseligible for garbage collection - the memory for the object can be reclaimed by the garbage collector
- 20A problem with the garbage collector isthat it is not guaranteed to perform its tasks at a specified time. For this reason destructors are rarely used
- 21Static VariableUsed when only one copy of a particular variable should be shared by all objects of a class
- 22Static variable representsclasswide information - all objects of the class share the same piece of data
- 23The scope of a static variableis the body of its class
- 24A classes public static variable can be accessed byqualifying the member name with the class name and the member access (.) operator as in Math.PI
- 25A classes private static class members can be accessed only throughthe methods and properties of the class
- 26String objects in C# areimmutable - they cannot be modified after they are created
- 27A method declared static cannot access non-static class members directly, becausea static method can be called even when no objects of the class exist
- 28The this reference cannot be used in astatic method
- 29readonly instance variableCan be initialized at execution time in constructor
Doesn't become unmodifiable until after the constructor completes execution - 30constmust be assigned values at compile time
- 31Default Valuethe same default value as any other instance variable, and the compiler generates a warning
- 32Information HidingWhen classes hide the details of their implementation from their clients
- 33Data AbstractionWhen the client cares about what functionality a class offers, not about how that functionality is implemented
- 34Abstract Data Types (ADT)Improves the app development process. Representations of real-world concepts to some satisfactory level of precision within a computer system. Captures two notions: a data representation and the operations that can be performed on that data
Ex. types such as int, double, and char - 35A queue returns items infirst-in, first-out (FIFO) order, which means that the first item inserted in a queue is the first item removed from the queue.
- 36Class ViewDisplays the fields, methods, and properties for all classes in a project
- 37Object BrowserUsed to learn about the functionality provided by a specific class
- 38Object InitializersAllows you to create an object and initialize its public properties and public instance variables if any in the same statement
Immediately followed by an object-initializer list list—a comma-separated list in curly braces ({ }) of properties and their values.
Information
- Description
- Flashcards on INSY 4306 Ch.10, created by Christopher Le on 04/11/2015.
- Created by
- Christopher Le
- Views
- 0
- Rating