Warm-up Exercises

Questions

  1. In C# each class you create becomes a new type and you can create objects of this type.
  • Yes
  • No
  1. What is “an instance of the class”?

  2. Write a statement that creates a new object from the Rectangle class.

  3. Do different objects from the same class share an instance variable?

  4. 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.

Problems