Question: In a new class called ArrayofCircles We are going to practice populating an array of objects Declare Circle Cir[] as an array and assign it
In a new class called ArrayofCircles
We are going to practice populating an array of objects
Declare Circle Cir[] as an array and assign it to 500 new circles.
- Practice initializing each circle individually using the following code:
cir[117]=new Circle (57.2);
3. Make the above code a comment.
4. Practice populating all 500 circles in a loop.
For (int j=0; j<500;j++)
{
cir[j]=new Circle(10);
}
5. Add your documentation
Which of these methods will be easiest for 500 circles? Why? Type your answer in a comment at the bottom of your program.
Step by Step Solution
3.45 Rating (158 Votes )
There are 3 Steps involved in it
Heres an example of the requested code with comments and documentation ArrayofCircles class to practice populating an array of Circle objects public c... View full answer
Get step-by-step solutions from verified subject matter experts
