Warm-up Exercises
Questions
- In C# each class you create becomes a new type and you can create objects of this type.
- Yes
- No
-
What is “an instance of the class”?
-
Write a statement that creates a new object from the
Rectangle
class. -
Do different objects from the same class share an instance variable?
-
Suppose we have a
Circle
class containing
public void SetRadius(double RadiusArgument)
{
radius = RadiusArgument;
}
Write a statement that creates a Circle
object, and one statement that
sets its radius to 3.5.