Write a program that displays a circle of radius 10pixels filled with a random color at a random location on a panel. When you click the circle, it is gone and a new random-color circle is displayed at another random location. After twenty circles are clicked, display the time spent in the panel.
Winston Gutkowski wrote:
Ryan Sykes wrote:An abstract class cannot be instantiated, and must have at least one unimplemented (i.e. abstract) method.
The second part of that is not true (although more often than not an abstract class will have at least one abstract method); perhaps you're thinking of C++.
Jeff Verdegan wrote:
Winston Gutkowski wrote:
Jeff Verdegan wrote:Composition is a HAS-A relationship, not IS-A.
Yes, but it can be used to simply extend a class's capabilities, especially when you're not really sure if you want to tie them together or not (or publicize the relationship to clients). I guess what I was trying to say is that inheritance should be used sparingly.
Winston
Exactly. Prefer composition over inheritance, as they say.
Rajesh Shekar wrote:Also i assume if i move the method outside main i need to create an object for the class "MethodTest" and call the calcArea method is that right?
Christina Bremmerman wrote:
Ah I know of this...and I guess I missed it because of my other issues
I can either change the 100 to 101 or change the 99 to 98? Would it work as well to change >99 to ==99?
Heather Hamrick wrote:I have a while loop because thats what my professor has told us to do within our program, so I guess that should be in my main?