C# Chapter 11
public static void ExchangeContents (ref T value1, ref T value2) { T temp; temp = value1; value1 = value2; value2 = temp; } Which of the following is TRUE regarding the above segment of code?
All of the options are correct.
The reserved word base, placed in the constructor heading before the opening curly brace, is used to indicate the base class constructor should be called.
True
When you override a method, the signatures of the methods must match.
True
It is not necessary to add a reference to a .dll file if the file is stored in the same project subdirectory.
False
Multiple classes can implement the same interface, but a class can implement only one interface.
False
Software components often take the form of classes or collections of methods.
False
Through defining the methods of a class as private, you protect the class.
False
Today applications are normally designed to be single, self-contained, monolithic programs.
False
You cannot spread the definition of your classes over multiple files using the partial keyword. Partial classes are reserved for use by the IDE.
False
You have experienced the use of polymorphism in programs through the use of the Main( ) method.
False
In addition to creating the console and Windows applications you've already created, you can create class library files with a dynamic link library (.EXE) extension that can be reused.
False
All .NET languages support multiple inheritance.
False
For classes of animal and dog, animal would be considered the derived class.
False
Abstraction provides a way to simplify complex problems by generalizing and then representing only essential features appropriate to the problem.
True
Class library components should be compiled using a Build option instead of Running the application.
True
Object-oriented development focuses on designing classes that can be reused. One way to ensure this reuse is through designing and building components that can be stored in a library and called on when needed.
True
Once a DLL is available, any application can add a reference to the DLL. The referenced file with the .dll extension becomes part of the application's private assembly.
True
Partial classes enable a class to be split into two or more files and combined when the application is compiled and ran.
True
The Unified Modeling Language (UML) notation for the interfaces specifies that the name of the Interface methods should appear in italics.
True
Use the ____ keyword to mark a class so that it can be used only as the base class from which other classes can be derived.
abstract
The base default constructor is called by ____.
adding base( ): between the constructor heading and the opening curly brace
Variables declared as dynamic ____.
can hold any type of value
Classes can have a "has a" relationship. This is a concept called ____ or aggregation.
containment
Determining which method to call at runtime based on which object invokes the method describes ____.
dynamic binding
By defining data members as private, you protect the data and enable access only through the object's methods and properties. This describes the ____ feature.
encapsulation
Packaging data attributes and behaviors into a single unit so that implementation details can be hidden describes ____ as it relates to object oriented development.
encapsulation
Prior to the introduction of generics, one way to write reusable code was to use the ____ data type for instance data members.
object
If you do not want subclasses to be able to provide new implementation details, you can add the keyword ____ to methods. Doing so keeps derived classes from being able to override the method.
sealed
When you add the virtual keyword to a method heading, it ____.
tags the method as capable of being overridden.
Which keyword instructs the compiler to infer the type of the variable from the expression on the right side of the initialization statement?
var