Question: Using C#, Create class Rectangle. * The class has attributes length and width, each of which defaults to 1. * One instance constructor that initializes
Using C#, Create class Rectangle. * The class has attributes length and width, each of which defaults to 1. * One instance constructor that initializes the attributes length and width when an instance is created * It has several methods as described below: methodA - this is a static method that can only be accessed inside of the class Rectangle. It calculates the Area of the rectangle. methodB - this is a static method that can be accessed from another class. It calculates the Area of the rectangle. methodC - this is an instance method that can only be accessed inside of the class Rectangle. It calculates the Area of the rectangle. methodD - this is an instance method that can be accessed from another class. It calculates the Area of the rectangle. * in the Main method, each method above is called * Write class testRectangle to call the methods in class Rectangle that can be accessed by class testRectangle.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
