10.1Fill in the blanks in each of the following statements:
The public
members of a class are also known as the class’s or .
If a method contains a local variable with the same name as one of its class’s fields, the local variable the field in that method’s scope.
The is called by the garbage collector before it reclaims an object’s memory.
If a class declares constructors, the compiler will not create a(n) .
An object’s method can be called implicitly when an object appears in code where a string
is needed.
Composition is sometimes referred to as a(n) relationship.
A(n) variable represents classwide information that’s shared by all the objects of the class.
The states that code should be granted only the amount of access needed to accomplish its designated task.
Declaring an instance variable with keyword specifies that the variable is not modifiable.
The operator returns the string
representation of an identifier’s name.
enables you to define how built-in operators work with objects of your own types.
enable you to add new capabilities to existing types.
10.2 Suppose class Book
defines properties Title
, Author
and Year
. Use an object initializer to create an object of class Book
and initialize its properties.