I'm having some trouble with an assignment of mine when it comes to the printing out the sorted array part of the assignment. (Lines 95-98 specifically, although my problem may be coming from another location. This section was just the default code that was provided already.)
I have a feeling it may have something to do with my array I created in trying to print it. How ever I have tried lots of different things like but I have a feeling this is totally the wrong direction to go.
Still a beginner to all of this and some help would be awesome.
It compiles and runs with it commented out so I know the other classes are fine.
Mike Johnston wrote:I have a feeling it may have something to do with my array I created in trying to print it. How ever I have tried lots of different things like but I have a feeling this is totally the wrong direction to go.
Still a beginner to all of this and some help would be awesome.
Every class has a toString() method that you are allowed to redefine. I'd suggest you start there.
Implement this method for each of your Shape classes in the form that you want, and then do something like:
Winston
Isn't it funny how there's always time and money enough to do it WRONG?
Mike Johnston
Greenhorn
Joined: Jan 17, 2012
Posts: 11
posted
0
Oops sorry.. I thought I had included my error.. Basically I'm getting
when I try and compile it (that is with line 95 uncommented and the others commented. I can't seem to find out why I can't find variable"r" (I'm assuming because variable"r" is saved into the array).