I discussed that and noted that it's a preferred construction but either is acceptable.
Ya . . . I think I covered that too, if I understand your meaning.
Type: Posts; User: GregBrannon
I discussed that and noted that it's a preferred construction but either is acceptable.
Ya . . . I think I covered that too, if I understand your meaning.
I would do it something like:
Shape[] shapes = new Shape[NUMBER_OF_SHAPES];
where NUMBER_OF_SHAPES is a previously defined constant. This:
Shape shapes[], and this:
Shape[] shapes
You should find reading this helpful. Most of the classes you'll write will be concrete (non-Abstract). When you're writing an Abstract class or an interface, you'll have specific reasons for doing...
Abstract classes cannot be instantiated. Does Circle need to be abstract? ShapeDemo shouldn't be abstract.
The ShapeDemo class has statements - lines that are expected to execute, like:
array[0]=o1;
that must be inside a method.
I would expect there to be a main() method somewhere, and I don't...
Please review the Announcement topic at the topic of each sub-forum to learn how to post your code in code or highlighting tags. What you've posted is hard to read.
However, it was readable in...