C# final
Which operators cannot be overloaded?
&& ?: = || ??
What statement regarding the use of the Object class and classes in general is accurate? a. The object class contains a constructor, destructor, and two public instance methods b. When you create any child class, no inheritance occurs automatically c. All classes inherit the Object class methods d. Although every class descends from Object, not all objects are Objects.
All classes inherit the Object class methods
*What happens when you declare a property defined in a base class as override in a derived class?* a. The new declaration removes the old declaration at compile time b. The new declaration is used when the compiler deems it appropriate c. The new declaration is eliminated in favor of the old declaration d. The new declaration overrides and hides its counterpart in the parent class
The new declaration overrides and hides its counterpart in the parent class
An ____ method has no method statements
abstract
in "public class myClass", public is the class ______ ______
access modifier
Totals that are summed one at a time in a loop are known as what type of totals? a.decremented b.derived c.incremented d.accumulated
accumulated
An ______ parameter is an argument within a method call
actual
The ____ of a derived class are all the superclasses from which the subclass is derivced
ancestors
An ____ is a group of code modules compiled together to create a program
assembly
{get; set;} is an ____ _______ property
auto-implemented
A ____ field has a property coded for it
backing
*What keyword always refers to the superclass of the class in which you use it?* a. parent b. super c. base d. upper
base
A superclass is a ____ class
base
______ rules determine the best overloaded method to execute based on the method call's arguments
betterness
Code _____ is unnecessarily long or repetitive statements
bloat
A ____ method is invoked by another method
called
Besides being known as a class client, what is a class that instantiates objects of another prewritten class known as? a.a class state b.a class instantiation c.a class user d.a server class
class user
A parameterless constructor is the ______ constructor
default
What kind of constructor takes no arguments whatsoever? a. construct array b. default constructor c. object constructor d. construct initializer
default constructor
~Employee( ) is a _____ in the Employee class
destructor
If negative is returned from CompareTo( ), the instances is ____ than the compared object
less
A _____ _____ is a method in another method that can only be called from the containing method
local function
A ______ _______ is a group of files containing methods that work together to create an application
multifile assembly
*What is the term used to describe the calling of a method from within another method?* a. nested method calling b. method children c. method cascading d. interleaved method calling
nested method calling
What keyword is an alias for the System.Object class? a. base b. super c. object d. parent
object
An overloaded operator is used to use operators between _____
objects
*What type of parameter to a method will have a value automatically supplied if you do not explicitly send one as an argument?* a. actual parameter b. default parameter c. optional parameter d. value parameter
optional
An ______ parameter allows a default value to be supplied if one is not explicitly sent as an argument
optional
*What modifier is used to indicate that a parameter is used for output?* a. ref b. params c. get d. out
out
*What accessibility modifier limits method access to the class that contains the method?* a. internal b. protected c. protected internal d. private
private
A _____ method limits access to its containing class
private
A member of a class that provides access to a field of a class is referred to as what? a. property b. explicit parameter c. reference type d. implicit parameter
property
_____ fields and methods can be used in their own class or any of its child classes
protected
How do you make a parameter optional?
providing a value for it in the method declaration
A _____ method allows unlimited access by any class
public
_____ describes a method that calls itself
recursive
*What type of parameter requires that the argument used to call the method must have an assigned value?* a. formal b. optional c. output d. reference
reference
A ____ type holds a memory address
reference
A ______ is a memory address
reference
______ ______ occurs when 2 reference type objects refer to the same object
reference equality
A ____ class cannot be extended
sealed
A method's _____ includes its name and parameter list
signature
*What keyword modifier indicates that a method can be called by referring to the class rather than an object from the class?* a. static b. nonstatic c. protected d. internal
static
A _____ method is called without an object reference and can be called without any arguments in its own class
static
_____ classes are not intended to be instantiated (only containing _____ members and classes) and cannot be extended
static
A method's name and parameter list both constitute what component of the method? a.The method stamp b.The method's type c.The return type for the method d.The method's signature
the method's signature
What are the set of attributes of an object's instance variable known as? a.The object's state. b.The object's relationship. c.The object's fields. d.The object's class instantiation.
the object's state
What reference is passed implicitly and invisibly to every instance method and property accessor? a.object b.static c.this d.use
this
_____ is the inheritance feature where a child inherits all the members of its ancestors
transitive
t/f - A method declared abstract must be overridden
true
t/f - CoffeeOrder[] coffeeArray = new CoffeeOrder[50] reserves enough memory for 50 CoffeeOrder objects
true
t/f - an overloaded operator must be static
true
*What type of parameter requires you to indicate the parameter's type and name, and the method receives a copy of the value passed to it?* a. value parameter b. reference parameter c. input parameter d. output parameter
value parameter
*A formal parameter that receives a copy of the value passed to it is an example of what type of parameter?* a. input b. reference c. output d. value
value(???)
*In the event that a method that should be overridden in a child class has its own implementation, what should you declare the base class method to be?* a. virtual b. abstract c. static d. valid
virtual
A method must have the ____ keyword to be overridden by a method in a child class
virtual
What method can you use to return a unique hash for different objects, so long as you explicitly implement it in a derived class? a.ToHash( ) b.GetHashGen( ) c.CalcHash( ) d.GetHashCode( )
GetHashCode( )
What interface in C# contains the definition for the CompareTo() method that compares one object to another and returns an integer? a.ICompareTo b.CompareTo c.IComparable d.Comparable
IComparable
Where are the data components of a class that differ for each object stored? a. Inside of instance variables b. In variable unit states c. Inside parent object relationships d. Inside constants
Inside of instance variables
What happens when a method overrides another method? a.It takes precedence over the original method, hiding it b.It extends the original method, adding additional functionality c.It overloads the original method, allowing for varying parameters d.It instantiates that method and takes over its properties
It takes precedence over the original method, hiding it.
*When declaring a method, how any params keywords are permitted?* a. There is no limit to the use of the keyword b. Only as many as there will be arguments c. Two, provided there is a nested method d. Only one params keyword is permitted.
Only one params keyword is permitted.
*When can a method be called with fewer arguments than exist in the parameter list for the method?* a. Only when the parameters are marked as non-critical parameters b. Only when default arguments are defined for the method c. Only when scope relaxation is used to allow global variables d. Only when value parameters are passed by other parts of the program
Only when default arguments are defined for the method
*When a variable or constant is required by multiple methods in a GUI program, where should it be defined?* a. Inside a nested method shared by both methods b. Outside of the methods, but inside of the Form class shared by both method c. Inside one of the methods used by the GUI d. Inside of an inherited class.
Outside of the methods, but inside of the Form class shared by both methods
How do protected & private classes differ?
Protected classes can be accessed by any classes derived from that class using inheritance. Private classes can only be accessed by itself
Why do event-driven GUI programs sometimes require fewer coded loops than their counterpart console applications? a .A GUI's properties removes the need for some loops b.GUI programs have better loop performance and can benefit more from loop fusion c.A GUI program can utilize loop nesting, while a console program cannot d.Some events are determined by the user's actions when the program is running.
Some events are determined by the user's actions when the program is running.
An _____ is a collection of abstract methods that can be used by any class
interface
What class access modifier should you utilize to limit access to the assembly (a group of code modules compiled together) to which the class belongs? a. internal b. protected c. private d. public
internal
An _____ object calls an instance method
invoking
What statement regarding the use of destructors is accurate? a. A destructor performs actions when a class is instantiated b. To declare a destructor, you must use a dash - followed by the class name c. You cannot provide any arguments to a destructor d. A destructor must be explicitly created
You cannot provide any arguments to a destructor
*To more easily incorporate methods into a program, it is common practice to store methods in their own classes and files. Then you can add them into any application that uses them. What is the resulting compound program called?* a. a compound interface b. a hid implementation c. a hid assembly d. a multifile assembly
a multifile assembly
_____ is using an object within another object
composition
What keyword can be used to create a named identifier for a memory location whose contents cannot change? a. static b. const c. fix d. final
const
A ____ is a method that creates an instance of an object
constructor
As an alternative to repeating code in multiple constructors, what can be used to indicate that another instance of a class constructor should be executed before any statements in the current constructor body? a. parameterless constructor b. default constructor c. constructor initializer d. value constructor
constructor initializer
public Coffee(int orderNumber) : this (orderNumber, "no flavor") is an example of a ____ _____
constructor initializer
What command can be used from the Developer Command Prompt in order to compile a C# program? a. c#-compile b. gcc-c# c. csharpc d. csc
csc
If 0 is returned from CompareTo( ), the instances is ____ to the compared object
equal
t/f - A method declared virtual must be overridden
false
t/f - CoffeeOrder[] coffeeArray = new CoffeeOrder[50] constructs 50 CoffeeOrder objects
false
t/f - When you create an array of objects, the array holds the actual value of each of the objects.
false
t/f - ref, out, and params can have default values
false
What is another name used for instance variables in order to help distinguish them from other variables you might use? a. states b. relationships c. instantiations d. fields
fields
A ______ parameter is a parameter in a method header that accepts a value
formal
_____ classes depend on field names from their parent classes because they are prone to errors
fragile
A readonly property has a ____ accessor, but not a ____ accessor
get; set
Most often, an instance of a class is destroyed when it ____________
goes out of scope
If positive is returned from CompareTo( ), the instances is ____ than the compared object
greater
A ____ ____ is a number that should uniquely identify an object
hash code
"public class myClass" is a class _____
header or definition
_____ a parent class member is overriding it in a derived class
hiding
What kind of programming language allows you to use a vocabulary of reasonable terms such as "read," "write," or "add" instead of the sequence of on/off switches that perform these tasks? a.low-level b.machine-level c.high-level d.switch-level
high-level
A parameter that is undeclared and that gets its value automatically is considered to be what type of parameter? a.property b.implicit c.explicit d.instance
implicit
An ___ reference conversion happens when a derived class object is assigned to its ancestor's data type
implicit
An ____ parameter is undeclared and gets its value automatically
implicit
When using arithmetic operations with operands of dissimilar types, an automatic conversion of nonconforming operands to a unifying type occurs. What is this conversion process called? a. level cast b. implicit cast c. explicit cast d. manual cast
implicit cast
Using private fields within classes is an example of what feature found in all object-oriented languages? a. overloading b. inheritance c. information hiding d. polymorphism
information hiding
_____ _____ describes a class's data being private and changed only by its own methods
information hiding
An ____ is a data type, like a class, that is a collection of empty abstract methods that can be used by any class
interface