1.
Which of the following general statements about a class are true?
A class represents a concept in an application domain A class defines a new data type A class contains data and operations all of the above A class is a fundamental concept to object oriented programming. The common one line
explanation for a class is that it "represents a concept in an application domain". More practical
descriptions typically describe a class as defining a new data type that contains data (fields)
and operations (methods).
2.
True or false: instance fields are allocated for each instance of a class.
True False Allocating an instance of a class type reserves memory for each instance field; thus
each instance gets its own copy of all instance fields.
3.
True or false: the keyword this is always required to access fields from inside a
class method?
True False The keyword this is only required when there is ambiguity; for example, when
a local variable or parameter exists with the same name as a field. Note that it is legal to include
the keyword this even when it is not needed.
4.
What is the default access level for class members?
public private protected Class members default to private access level. The class designer can
use the keyword private to be explicit but it is not necessary. An access level of
private means that the member is only accessible to code inside the class.
5.
How many different parameter passing mechanisms are provided by the C# language?
1 2 3 There are 3 basic parameter passing mechanisms in C#: value, reference, and out. Pass by
value is the default and does not have an associated keyword. Pass by reference is achieved using the
ref keyword. Out parameters are created using the out keyword.
6.
When two or more methods in a class are defined with the same name, but different parameter
lists, those methods are said to be what?
Overpowered Overridden Overloaded Overutilized The traditional term for multiple methods with the same name inside a class is
overloaded.