Deck 10: Classes and Objects: A Deeper Look

Full screen (f)
exit full mode
Question
A class's initializes members of that class.

A) constructor
B) utility method
C) access modifier
D) None of the above.
Use Space or
up arrow
down arrow
to flip the card.
Question
Consider the statement:
Throw new ArgumentOutOfRangeException(0);
Which of the following statements is false

A) For values outside proper ranges, an app can throw an exception of type ArgumentOutOfRangeException (namespace System), which notifies the client code that an invalid argument was passed to the method.
B) This throw statement creates a new object of type ArgumentOutOfRangeException.
C) The parentheses following the class name indicate a call to the ArgumentOutOfRangeException constructor.
D) After the exception object is created, the statement after the throw statement is executed-this is called the resumption model of exception handling.
Question
Member access modifiers are used to limit how much memory is available for class members.
Question
Instances of a class are called class variables.
Question
The data components of a class are called instance variables.
Question
Programmers should not take into consideration that their code will be modified.
Question
A constructor should return either true or false to determine if the object was initialized properly.
Question
Object orientation uses classes to:

A) develop algorithms
B) encapsulate data and methods
C) organize large amounts of data
D) None of the above.
Question
Objects can hide their implementation from other objects.
Question
Instance variables or methods declared with the modifier are accessible only in that class definition.

A) protected
B) static
C) private
D) None of the above.
Question
Which statement is false

A) The actual data representation used within the class is of no concern to the class's clients.
B) Clients generally care about what the class does but not how the class does it.
C) Clients are usually involved in a class's implementation.
D) Hiding the implementation reduces the possibility that other program parts will become dependent on class-implementation details.
Question
Which of the following statements is true

A) Methods and instance variables can be public, protected or private.
B) Information hiding is achieved by restricting access to class members via keyword public.
C) The public members of a class are not directly accessible to the client of a class.
D) None of the above is true.
Question
Every class inherits directly or indirectly from class _________.

A) Inheritor
B) Base
C) Super
D) object
Question
The public methods of a class present the services that a class provides.
Question
An instance of a user-defined type is called a(n)

A) class
B) interface
C) object
D) None of the above.
Question
Variables or methods declared with access modifier public are accessible wherever the program has a reference to an object of the class.
Question
Variables declared within class methods are called instance variables.
Question
The purpose of utility methods is to support the operation of a class' other methods.
Question
The _________ of a class are also called the public services or the public interface of the class.

A) public constructors
B) public instance variables
C) public methods
D) All of the above
Question
Which of the following class members should usually be private

A) methods
B) constructors
C) variables
D) All of the above
Question
C#6] It's common to include in an exception's error message a variable's or property's identifier.This information can help a client-code programmer understand the context in which the exception occurred.Prior to C# 6,you had to hard code these identifiers into your error-message strings.As of C# 6,you can instead use the ________ operator,which returns a string representation of the identifier enclosed in parentheses.

A) valueof
B) stringof
C) characterof
D) nameof
Question
Which statement is false

A) The compiler always creates a default constructor for a class.
B) If a class has constructors, but none of the public constructors are parameterless, and a program attempts to call a parameterless constructor to initialize an object of the class, a compilation error occurs.
C) A constructor can be called with no arguments only if the class does not have any constructors or if the class has a public parameterless constructor.
D) Parameterless constructors do not have any arguments.
Question
A constructor cannot:

A) be overloaded.
B) initialize variables to their defaults.
C) specify return types or return values.
D) have the same name as the class.
Question
In a method in which a parameter has the same name as an instance variable,using the this reference allows you to refer to ________.

A) the parameter
B) the instance variable
C) varies depending on the situation
D) None of the above
Question
this is often used to distinguish between a local variable and class variable that share an identical name.
Question
Attempting to overload a constructor with another constructor that has the exact same signature (name and parameters)is a compilation error.
Question
Having a this reference allows:

A) A method to refer explicitly to the instance variables and other methods of the object on which the method was called.
B) A method to refer implicitly to the instance variables and other methods of the object on which the method was called.
C) An object to reference itself.
D) All of the above.
Question
When should a program explicitly use the this reference

A) accessing a private variable
B) accessing a public variable
C) accessing a local variable
D) accessing a field that is shadowed by a local variable
Question
The use of references to objects of preexisting classes as members of new objects is called

A) inheritance
B) composition
C) polymorphism
D) None of the above.
Question
The compiler will create a default constructor for a class even if you already declared a constructor(s).
Question
An object's this reference refers to:

A) the object itself
B) what the programmer assigned to this
C) the entry point of the program
D) None of the above.
Question
An attempt by a method which is not a member of a particular class to access a pri
vate member of that class is a fatal runtime error.
Question
C# invokes the appropriate constructor by matching the number,types and order of the parameters in the constructor call to those in each constructor definition.
Question
Only certain objects have a this reference.
Question
Every class must have at east one constructor.
Question
A constructor may not have a return value.
Question
Which of the following statements is true
Constructors:

A) initialize instance variables
B) when overloaded, can have identical argument lists
C) when overloaded, are selected by number and types of parameters
D) a and c
Question
An object of a class that has a reference to another object of the same class may access all the private data and methods of that class.
Question
A constructor may not call other methods.
Question
Only the first constructor for a class is defined without a return value.Subsequent constructors have the return type void.
Question
A can be defined in a class to perform termination housekeeping on an object before the garbage collector reclaims the object's memory.

A) destructor
B) property
C) garbage collector
D) None of the above.
Question
A class cannot have references to objects of other classes as members.
Question
A program contains a separate copy of a static variable for each object that's instantiated.
Question
Instance variables declared readonly do not or cannot:

A) use the principle of least privilege
B) be initialized
C) be modified once the object is constructed
D) cause syntax errors if used as a left-hand value
Question
Each object of a class has its own copy of all the instance variables of the class.
Question
Keyword is used for constants whose values cannot be determined at compile time.

A) const
B) readonly
C) static
D) None of the above.
Question
A static variable represents class-wide information.
Question
User-defined classes may be composed of other user-defined classes.
Question
You cannot determine when the garbage collector will execute.
Question
C# is like C++ in that programmers must manage memory explicitly.
Question
Composition is sometimes referred to as a(n)________.

A) is-a relationship
B) has-a relationship
C) have-a relationship
D) one-to-many relationship
Question
Which of the following describes a static variable

A) a variable with one copy shared by all class objects
B) a variable whose value may not be changed
C) all of the above
D) None of the above.
Question
Composition:

A) Is a form of software reuse.
B) Is using an object reference as a class member.
C) Is a good design practice.
D) All of the above.
Question
Failure to release resources when the program is no longer using them can cause
________.

A) buffer overflows
B) resource leaks
C) exceptions
D) None of the above.
Question
The garbage collector looks for objects with no values.
Question
Which of the following is false

A) A static method or property must be used to access private static instance variables.
B) A static method has no this reference.
C) A static method can be accessed even when no objects of its class have been instantiated.
D) A static method can call instance methods directly.
Question
Variables that are static have class scope.
Question
A static method may access static and non-static members.
Question
Composition is a form of software reuse.
Question
A destructor has the same name as the class and its constructor.
Question
Which of the following statements is false

A) Extension methods add functionality to a type by modifying the type's source code.
B) LINQ capabilities are implemented as extension methods.
C) Preceding an object parameter that's the first parameter in the method header with the this keyword indicates that the method extends an existing type. The compiler uses this information to add code into the compiled program that enables extension methods to work with existing types.
D) The type of an extension method's first parameter specifies the type that you're extending.
Question
The classes,variables and methods in a program are displayed in a hierarchical structure in Class View.
Question
Operator overloading is the process of:

A) enabling C#'s operators to work with class objects
B) using operators to create new classes
C) using operators to specify which versions of overloaded methods to use
D) None of the above.
Question
Complex numbers have the form
RealPart + imaginaryPart * i
Where i is the square root of -1.Which of the following statements is false

A) C#'s simple numeric types are value types.
B) To mimic the simple numeric types, we can define ComplexNumber as a value type by using a struct (short for "structure") rather than a class.
C) C#'s simple types like int and double are actually aliases for struct types.
D) Microsoft recommends using structs for most new types, but recommends a class if the type represents a single value.
Question
Object initializers (which initialize an object and its properties)use what syntax

A) new className(property1 - > value1, …);
B) new className(property1 = value1, …);
C) new className{property1 = value1, …};
D) className{property1 = value1, …};
Question
Operators should be overloaded to perform actions similar to those that they normally perform on objects of simple types.
Question
Methods that overload binary operators must take two arguments.
Question
At least one argument of an operator overload method must be a reference to an object of the class in which the operator is overloaded.
Question
displays the variables and methods for all classes in a project.

A) Class View
B) Object Browser
C) Design View
D) None of the above.
Question
An object initializer list cannot be empty.
Question
Attempting to modify a readonly instance variable after it's initialized is a fatal execution-time error.
Question
Data members declared as readonly must be initialized in their declaration.
Question
The Object Browser _____________.

A) lists all the classes in the C# library
B) describes the functionality provided by a specific class
C) is separated into 3 frames
D) All of the above.
Question
You cannot validate values assigned to properties using an object initializer.
Question
Developers use the Object Browser to learn about the functionality provided by a specific class.
Question
Which of the following statements is false

A) Extension methods must be defined as static methods in a static class.
B) The compiler implicitly passes the object that's used to call the method as the extension method's first argument. This allows you to call an extension method as if it were an instance method of the extended class.
C) An extension method's fully qualified name is the name of the class in which the extension method is defined, followed by the name of the method and its argument list. When using the fully qualified method name, you must specify an argument for the first parameter.
D) If the type being extended defines an instance method with the same name as your extension method and a compatible signature, the extension method shadows the instance method.
Question
Overloaded operator methods must be declared public and ________.

A) sealed
B) protected
C) static
D) None of the above.
Question
Keyword _______ is used to indicate a method overloads a specific operator.

A) implement
B) operator
C) overload
D) op
Question
An object initializer calls the default constructor before executing.
Unlock Deck
Sign up to unlock the cards in this deck!
Unlock Deck
Unlock Deck
1/79
auto play flashcards
Play
simple tutorial
Full screen (f)
exit full mode
Deck 10: Classes and Objects: A Deeper Look
1
A class's initializes members of that class.

A) constructor
B) utility method
C) access modifier
D) None of the above.
A
2
Consider the statement:
Throw new ArgumentOutOfRangeException(0);
Which of the following statements is false

A) For values outside proper ranges, an app can throw an exception of type ArgumentOutOfRangeException (namespace System), which notifies the client code that an invalid argument was passed to the method.
B) This throw statement creates a new object of type ArgumentOutOfRangeException.
C) The parentheses following the class name indicate a call to the ArgumentOutOfRangeException constructor.
D) After the exception object is created, the statement after the throw statement is executed-this is called the resumption model of exception handling.
D
After the exception object is created,the statement after the throw statement is executed-this is called the resumption model of exception handling.Actually,the throw statement immediately terminates its enclosing method and the exception is returned to the code that attempted to call that method-this is the termination model of exception handling.
3
Member access modifiers are used to limit how much memory is available for class members.
False
Member access modifiers are used to control the accessibility of class members between separate classes.
4
Instances of a class are called class variables.
Unlock Deck
Unlock for access to all 79 flashcards in this deck.
Unlock Deck
k this deck
5
The data components of a class are called instance variables.
Unlock Deck
Unlock for access to all 79 flashcards in this deck.
Unlock Deck
k this deck
6
Programmers should not take into consideration that their code will be modified.
Unlock Deck
Unlock for access to all 79 flashcards in this deck.
Unlock Deck
k this deck
7
A constructor should return either true or false to determine if the object was initialized properly.
Unlock Deck
Unlock for access to all 79 flashcards in this deck.
Unlock Deck
k this deck
8
Object orientation uses classes to:

A) develop algorithms
B) encapsulate data and methods
C) organize large amounts of data
D) None of the above.
Unlock Deck
Unlock for access to all 79 flashcards in this deck.
Unlock Deck
k this deck
9
Objects can hide their implementation from other objects.
Unlock Deck
Unlock for access to all 79 flashcards in this deck.
Unlock Deck
k this deck
10
Instance variables or methods declared with the modifier are accessible only in that class definition.

A) protected
B) static
C) private
D) None of the above.
Unlock Deck
Unlock for access to all 79 flashcards in this deck.
Unlock Deck
k this deck
11
Which statement is false

A) The actual data representation used within the class is of no concern to the class's clients.
B) Clients generally care about what the class does but not how the class does it.
C) Clients are usually involved in a class's implementation.
D) Hiding the implementation reduces the possibility that other program parts will become dependent on class-implementation details.
Unlock Deck
Unlock for access to all 79 flashcards in this deck.
Unlock Deck
k this deck
12
Which of the following statements is true

A) Methods and instance variables can be public, protected or private.
B) Information hiding is achieved by restricting access to class members via keyword public.
C) The public members of a class are not directly accessible to the client of a class.
D) None of the above is true.
Unlock Deck
Unlock for access to all 79 flashcards in this deck.
Unlock Deck
k this deck
13
Every class inherits directly or indirectly from class _________.

A) Inheritor
B) Base
C) Super
D) object
Unlock Deck
Unlock for access to all 79 flashcards in this deck.
Unlock Deck
k this deck
14
The public methods of a class present the services that a class provides.
Unlock Deck
Unlock for access to all 79 flashcards in this deck.
Unlock Deck
k this deck
15
An instance of a user-defined type is called a(n)

A) class
B) interface
C) object
D) None of the above.
Unlock Deck
Unlock for access to all 79 flashcards in this deck.
Unlock Deck
k this deck
16
Variables or methods declared with access modifier public are accessible wherever the program has a reference to an object of the class.
Unlock Deck
Unlock for access to all 79 flashcards in this deck.
Unlock Deck
k this deck
17
Variables declared within class methods are called instance variables.
Unlock Deck
Unlock for access to all 79 flashcards in this deck.
Unlock Deck
k this deck
18
The purpose of utility methods is to support the operation of a class' other methods.
Unlock Deck
Unlock for access to all 79 flashcards in this deck.
Unlock Deck
k this deck
19
The _________ of a class are also called the public services or the public interface of the class.

A) public constructors
B) public instance variables
C) public methods
D) All of the above
Unlock Deck
Unlock for access to all 79 flashcards in this deck.
Unlock Deck
k this deck
20
Which of the following class members should usually be private

A) methods
B) constructors
C) variables
D) All of the above
Unlock Deck
Unlock for access to all 79 flashcards in this deck.
Unlock Deck
k this deck
21
C#6] It's common to include in an exception's error message a variable's or property's identifier.This information can help a client-code programmer understand the context in which the exception occurred.Prior to C# 6,you had to hard code these identifiers into your error-message strings.As of C# 6,you can instead use the ________ operator,which returns a string representation of the identifier enclosed in parentheses.

A) valueof
B) stringof
C) characterof
D) nameof
Unlock Deck
Unlock for access to all 79 flashcards in this deck.
Unlock Deck
k this deck
22
Which statement is false

A) The compiler always creates a default constructor for a class.
B) If a class has constructors, but none of the public constructors are parameterless, and a program attempts to call a parameterless constructor to initialize an object of the class, a compilation error occurs.
C) A constructor can be called with no arguments only if the class does not have any constructors or if the class has a public parameterless constructor.
D) Parameterless constructors do not have any arguments.
Unlock Deck
Unlock for access to all 79 flashcards in this deck.
Unlock Deck
k this deck
23
A constructor cannot:

A) be overloaded.
B) initialize variables to their defaults.
C) specify return types or return values.
D) have the same name as the class.
Unlock Deck
Unlock for access to all 79 flashcards in this deck.
Unlock Deck
k this deck
24
In a method in which a parameter has the same name as an instance variable,using the this reference allows you to refer to ________.

A) the parameter
B) the instance variable
C) varies depending on the situation
D) None of the above
Unlock Deck
Unlock for access to all 79 flashcards in this deck.
Unlock Deck
k this deck
25
this is often used to distinguish between a local variable and class variable that share an identical name.
Unlock Deck
Unlock for access to all 79 flashcards in this deck.
Unlock Deck
k this deck
26
Attempting to overload a constructor with another constructor that has the exact same signature (name and parameters)is a compilation error.
Unlock Deck
Unlock for access to all 79 flashcards in this deck.
Unlock Deck
k this deck
27
Having a this reference allows:

A) A method to refer explicitly to the instance variables and other methods of the object on which the method was called.
B) A method to refer implicitly to the instance variables and other methods of the object on which the method was called.
C) An object to reference itself.
D) All of the above.
Unlock Deck
Unlock for access to all 79 flashcards in this deck.
Unlock Deck
k this deck
28
When should a program explicitly use the this reference

A) accessing a private variable
B) accessing a public variable
C) accessing a local variable
D) accessing a field that is shadowed by a local variable
Unlock Deck
Unlock for access to all 79 flashcards in this deck.
Unlock Deck
k this deck
29
The use of references to objects of preexisting classes as members of new objects is called

A) inheritance
B) composition
C) polymorphism
D) None of the above.
Unlock Deck
Unlock for access to all 79 flashcards in this deck.
Unlock Deck
k this deck
30
The compiler will create a default constructor for a class even if you already declared a constructor(s).
Unlock Deck
Unlock for access to all 79 flashcards in this deck.
Unlock Deck
k this deck
31
An object's this reference refers to:

A) the object itself
B) what the programmer assigned to this
C) the entry point of the program
D) None of the above.
Unlock Deck
Unlock for access to all 79 flashcards in this deck.
Unlock Deck
k this deck
32
An attempt by a method which is not a member of a particular class to access a pri
vate member of that class is a fatal runtime error.
Unlock Deck
Unlock for access to all 79 flashcards in this deck.
Unlock Deck
k this deck
33
C# invokes the appropriate constructor by matching the number,types and order of the parameters in the constructor call to those in each constructor definition.
Unlock Deck
Unlock for access to all 79 flashcards in this deck.
Unlock Deck
k this deck
34
Only certain objects have a this reference.
Unlock Deck
Unlock for access to all 79 flashcards in this deck.
Unlock Deck
k this deck
35
Every class must have at east one constructor.
Unlock Deck
Unlock for access to all 79 flashcards in this deck.
Unlock Deck
k this deck
36
A constructor may not have a return value.
Unlock Deck
Unlock for access to all 79 flashcards in this deck.
Unlock Deck
k this deck
37
Which of the following statements is true
Constructors:

A) initialize instance variables
B) when overloaded, can have identical argument lists
C) when overloaded, are selected by number and types of parameters
D) a and c
Unlock Deck
Unlock for access to all 79 flashcards in this deck.
Unlock Deck
k this deck
38
An object of a class that has a reference to another object of the same class may access all the private data and methods of that class.
Unlock Deck
Unlock for access to all 79 flashcards in this deck.
Unlock Deck
k this deck
39
A constructor may not call other methods.
Unlock Deck
Unlock for access to all 79 flashcards in this deck.
Unlock Deck
k this deck
40
Only the first constructor for a class is defined without a return value.Subsequent constructors have the return type void.
Unlock Deck
Unlock for access to all 79 flashcards in this deck.
Unlock Deck
k this deck
41
A can be defined in a class to perform termination housekeeping on an object before the garbage collector reclaims the object's memory.

A) destructor
B) property
C) garbage collector
D) None of the above.
Unlock Deck
Unlock for access to all 79 flashcards in this deck.
Unlock Deck
k this deck
42
A class cannot have references to objects of other classes as members.
Unlock Deck
Unlock for access to all 79 flashcards in this deck.
Unlock Deck
k this deck
43
A program contains a separate copy of a static variable for each object that's instantiated.
Unlock Deck
Unlock for access to all 79 flashcards in this deck.
Unlock Deck
k this deck
44
Instance variables declared readonly do not or cannot:

A) use the principle of least privilege
B) be initialized
C) be modified once the object is constructed
D) cause syntax errors if used as a left-hand value
Unlock Deck
Unlock for access to all 79 flashcards in this deck.
Unlock Deck
k this deck
45
Each object of a class has its own copy of all the instance variables of the class.
Unlock Deck
Unlock for access to all 79 flashcards in this deck.
Unlock Deck
k this deck
46
Keyword is used for constants whose values cannot be determined at compile time.

A) const
B) readonly
C) static
D) None of the above.
Unlock Deck
Unlock for access to all 79 flashcards in this deck.
Unlock Deck
k this deck
47
A static variable represents class-wide information.
Unlock Deck
Unlock for access to all 79 flashcards in this deck.
Unlock Deck
k this deck
48
User-defined classes may be composed of other user-defined classes.
Unlock Deck
Unlock for access to all 79 flashcards in this deck.
Unlock Deck
k this deck
49
You cannot determine when the garbage collector will execute.
Unlock Deck
Unlock for access to all 79 flashcards in this deck.
Unlock Deck
k this deck
50
C# is like C++ in that programmers must manage memory explicitly.
Unlock Deck
Unlock for access to all 79 flashcards in this deck.
Unlock Deck
k this deck
51
Composition is sometimes referred to as a(n)________.

A) is-a relationship
B) has-a relationship
C) have-a relationship
D) one-to-many relationship
Unlock Deck
Unlock for access to all 79 flashcards in this deck.
Unlock Deck
k this deck
52
Which of the following describes a static variable

A) a variable with one copy shared by all class objects
B) a variable whose value may not be changed
C) all of the above
D) None of the above.
Unlock Deck
Unlock for access to all 79 flashcards in this deck.
Unlock Deck
k this deck
53
Composition:

A) Is a form of software reuse.
B) Is using an object reference as a class member.
C) Is a good design practice.
D) All of the above.
Unlock Deck
Unlock for access to all 79 flashcards in this deck.
Unlock Deck
k this deck
54
Failure to release resources when the program is no longer using them can cause
________.

A) buffer overflows
B) resource leaks
C) exceptions
D) None of the above.
Unlock Deck
Unlock for access to all 79 flashcards in this deck.
Unlock Deck
k this deck
55
The garbage collector looks for objects with no values.
Unlock Deck
Unlock for access to all 79 flashcards in this deck.
Unlock Deck
k this deck
56
Which of the following is false

A) A static method or property must be used to access private static instance variables.
B) A static method has no this reference.
C) A static method can be accessed even when no objects of its class have been instantiated.
D) A static method can call instance methods directly.
Unlock Deck
Unlock for access to all 79 flashcards in this deck.
Unlock Deck
k this deck
57
Variables that are static have class scope.
Unlock Deck
Unlock for access to all 79 flashcards in this deck.
Unlock Deck
k this deck
58
A static method may access static and non-static members.
Unlock Deck
Unlock for access to all 79 flashcards in this deck.
Unlock Deck
k this deck
59
Composition is a form of software reuse.
Unlock Deck
Unlock for access to all 79 flashcards in this deck.
Unlock Deck
k this deck
60
A destructor has the same name as the class and its constructor.
Unlock Deck
Unlock for access to all 79 flashcards in this deck.
Unlock Deck
k this deck
61
Which of the following statements is false

A) Extension methods add functionality to a type by modifying the type's source code.
B) LINQ capabilities are implemented as extension methods.
C) Preceding an object parameter that's the first parameter in the method header with the this keyword indicates that the method extends an existing type. The compiler uses this information to add code into the compiled program that enables extension methods to work with existing types.
D) The type of an extension method's first parameter specifies the type that you're extending.
Unlock Deck
Unlock for access to all 79 flashcards in this deck.
Unlock Deck
k this deck
62
The classes,variables and methods in a program are displayed in a hierarchical structure in Class View.
Unlock Deck
Unlock for access to all 79 flashcards in this deck.
Unlock Deck
k this deck
63
Operator overloading is the process of:

A) enabling C#'s operators to work with class objects
B) using operators to create new classes
C) using operators to specify which versions of overloaded methods to use
D) None of the above.
Unlock Deck
Unlock for access to all 79 flashcards in this deck.
Unlock Deck
k this deck
64
Complex numbers have the form
RealPart + imaginaryPart * i
Where i is the square root of -1.Which of the following statements is false

A) C#'s simple numeric types are value types.
B) To mimic the simple numeric types, we can define ComplexNumber as a value type by using a struct (short for "structure") rather than a class.
C) C#'s simple types like int and double are actually aliases for struct types.
D) Microsoft recommends using structs for most new types, but recommends a class if the type represents a single value.
Unlock Deck
Unlock for access to all 79 flashcards in this deck.
Unlock Deck
k this deck
65
Object initializers (which initialize an object and its properties)use what syntax

A) new className(property1 - > value1, …);
B) new className(property1 = value1, …);
C) new className{property1 = value1, …};
D) className{property1 = value1, …};
Unlock Deck
Unlock for access to all 79 flashcards in this deck.
Unlock Deck
k this deck
66
Operators should be overloaded to perform actions similar to those that they normally perform on objects of simple types.
Unlock Deck
Unlock for access to all 79 flashcards in this deck.
Unlock Deck
k this deck
67
Methods that overload binary operators must take two arguments.
Unlock Deck
Unlock for access to all 79 flashcards in this deck.
Unlock Deck
k this deck
68
At least one argument of an operator overload method must be a reference to an object of the class in which the operator is overloaded.
Unlock Deck
Unlock for access to all 79 flashcards in this deck.
Unlock Deck
k this deck
69
displays the variables and methods for all classes in a project.

A) Class View
B) Object Browser
C) Design View
D) None of the above.
Unlock Deck
Unlock for access to all 79 flashcards in this deck.
Unlock Deck
k this deck
70
An object initializer list cannot be empty.
Unlock Deck
Unlock for access to all 79 flashcards in this deck.
Unlock Deck
k this deck
71
Attempting to modify a readonly instance variable after it's initialized is a fatal execution-time error.
Unlock Deck
Unlock for access to all 79 flashcards in this deck.
Unlock Deck
k this deck
72
Data members declared as readonly must be initialized in their declaration.
Unlock Deck
Unlock for access to all 79 flashcards in this deck.
Unlock Deck
k this deck
73
The Object Browser _____________.

A) lists all the classes in the C# library
B) describes the functionality provided by a specific class
C) is separated into 3 frames
D) All of the above.
Unlock Deck
Unlock for access to all 79 flashcards in this deck.
Unlock Deck
k this deck
74
You cannot validate values assigned to properties using an object initializer.
Unlock Deck
Unlock for access to all 79 flashcards in this deck.
Unlock Deck
k this deck
75
Developers use the Object Browser to learn about the functionality provided by a specific class.
Unlock Deck
Unlock for access to all 79 flashcards in this deck.
Unlock Deck
k this deck
76
Which of the following statements is false

A) Extension methods must be defined as static methods in a static class.
B) The compiler implicitly passes the object that's used to call the method as the extension method's first argument. This allows you to call an extension method as if it were an instance method of the extended class.
C) An extension method's fully qualified name is the name of the class in which the extension method is defined, followed by the name of the method and its argument list. When using the fully qualified method name, you must specify an argument for the first parameter.
D) If the type being extended defines an instance method with the same name as your extension method and a compatible signature, the extension method shadows the instance method.
Unlock Deck
Unlock for access to all 79 flashcards in this deck.
Unlock Deck
k this deck
77
Overloaded operator methods must be declared public and ________.

A) sealed
B) protected
C) static
D) None of the above.
Unlock Deck
Unlock for access to all 79 flashcards in this deck.
Unlock Deck
k this deck
78
Keyword _______ is used to indicate a method overloads a specific operator.

A) implement
B) operator
C) overload
D) op
Unlock Deck
Unlock for access to all 79 flashcards in this deck.
Unlock Deck
k this deck
79
An object initializer calls the default constructor before executing.
Unlock Deck
Unlock for access to all 79 flashcards in this deck.
Unlock Deck
k this deck
locked card icon
Unlock Deck
Unlock for access to all 79 flashcards in this deck.