Module 4 Chapter Test
___ are special methods used to read the current state or value of an object member's data
Accessors
Which of the following is NOT a true statement relating to constructors?
The default constructor must be the first one written for the class.
In order to provide a new definition for the ToString() method,
Use the keyword ovveride in the heading
Constructors differ from other methods in that constructors ____.
Use the same identifier as the class
WriteLine("Value = {0:N0}", 12345.9032); What will be displayed from the above line?
Value = 12,346
The ToString() method is automatically invoked when an object reference is made in the ____.
Write() method
In order to test a class,
a different class is needed, invoke instance methods using the objects you contruct, use the properties to assign and retrieve values
Local variables
are defined inside Main( ) and other methods
When you define the class, you describe its __ in terms of data and its behaviors, or methods, in terms of what kinds of things it can do.
attributes
Constructors ___.
can be overloaded, do not have to be written, do not return a value.
C# is an object-oriented language. All the code for an application must be placed in a(n) ____.
class
A property resembles a(n) ____, but is more closely aligned to a(n) ___.
data field, method
A class is normally associated with a(n) ____, which often describes a person, place, or thing and is normally a noun.
entity
Accessory are also referred to as ___.
getters
To design a class that is flexible and full-featured, ____.
include multiple constructors
When you define a class, you can use ___ to display all public members of the class (once an object is instantiated)
intellisense
To program an object-oriented solution begin by determining what ____ are needed in the solution.
objects
Variables declared in the Main() method are ____.
only visible inside Main()
Class methods manipulate data by___.
passing information as arguments through parameters
plush.PricePerSqYard = 40.99; If proper naming conventions were used in the above statement, which of the following statements is true?
plush is an object, PircePerSqYard is a property, 40.99 is a numeric literal
Normally data members are defined to have ____ access
private
Accessors, mutators, and other instance methods are normally defined with what type of access modifier?
public
Constructors should be defined with a ___ access modifier
public
To define a property to change a data member of a class include a ____ clause.
set
To add functionality to your classes, ____.
write more than one constructor
