This chapter is from the book
Fill in the blanks in each of the following:
- A house is to a blueprint as a(n) _______ is to a class.
- Every class declaration contains keyword _______ followed immediately by the class's name.
- Operator _______ creates an object of the class specified to the right of the keyword.
- Each parameter must specify both a(n) _______ and a(n) _______.
- By default, classes that are not explicitly declared in a namespace are implicitly placed in the _______.
- When each object of a class maintains its own copy of an attribute, the field that represents the attribute is also known as a(n) _______.
- C# provides three simple types for storing real numbers—_______, _______ and _______.
- Variables of type double represent _______ floating-point numbers.
Convert method _______ returns a decimal value.
- Keyword public is a(n) _______.
- Return type _______ indicates that a method will not return any information when it completes its task.
Console method _______ reads characters until a newline character is encountered, then returns those characters (not including the newline) as a string.
- A(n) _______ is not required if you always refer to a class with its fully qualified class name.
- Variables of type float represent _______ floating-point numbers.
- The format specifier _______ is used to display values in a monetary format.
- Types are either _______ types or _______ types.
- For a(n) _______, the compiler automatically generates a private instance variable and set and get accessors.
State whether each of the following is true or false. If false, explain why.
- By convention, method names begin with a lowercase first letter and all subsequent words in the name begin with a capital first letter.
- A property's get accessor enables a client to modify the value of the instance variable associated with the property.
- A using directive is not required when one class in a namespace uses another in the same namespace.
- Empty parentheses following a method name in a method declaration indicate that the method does not require any parameters to perform its task.
- After defining a property, you can use it the same way you use a method, but with empty parentheses, because no arguments are passed to a property.
- Variables or methods declared with access modifier private are accessible only to methods and properties of the class in which they're declared.
- Variables declared in the body of a particular method are known as instance variables and can be used in all methods of the class.
- A property declaration must contain both a get accessor and a set accessor.
- The body of any method or property is delimited by left and right braces.
- Local variables are initialized by default.
- Reference-type instance variables are initialized by default to the value null.
- Any class that contains public static void Main( string args ) can be used to execute an application.
- The number of arguments in the method call must match the number of required parameters in the method declaration's parameter list.
- Real number values that appear in source code are known as floating-point literals and are of type float by default.
What is the difference between a local variable and an instance variable?
Explain the purpose of a method parameter. What is the difference between a parameter and an argument?