I have a few general questions about the assignment I'm completing
I'm trying real hard to understand this stuff, but have a poor textbook
and a worse instructor.
The assignment deals with Shape hierarchy
I've created several class files for this package Shape is a super class TwoDimensionalShape and ThreeDimensionalShape classes extend Shape Square and Circle extend TwoDimensionalShape Cube and Sphere extend ThreeDimensionalShape
Now for the questions.
I know what the concrete methods of the abstract methods of the superclass, but do I have some special keyword or other way of identifying them? or do I just declare them like a normal method.
What is protected used for. My text only says that it is a legal keyword for a class or method, but doesn't explain anything.
and very specifically, the only error in my 11 file program:
in my class cube I have this method:
I have essentially the same code in class Sphere, and it compiles OK.
the toString method is in Shape - two levels up from Sphere and Cube.
again, Sphere and Cube both extend ThreeDimensionalShape ThreeDimensionalShape is abstract ThreeDimensionalShape extends Shape Shape is also abstract all are public, none are static
(This is my last assignment in this class. I'm going to buy HeadFirst Java and learn it for real now)
You're welcome. And Stevi Deter's quote gives the same information, which I hadn't noticed earlier. Sorry.
BTW: which book is it you don't like?
Joined: Apr 03, 2008
Thanks for all the help
Who'd of thought - a typo.
My frustration over the textbook would probably be better directed at the instructor.
I'm taking this course at a local community college.
I chose to take it there BECAUSE I didn't want self instruction.
This whole semester we've had one lecture - and it was "THIS CLASS CONSISTS ENTIRELY OF LABS- DON'T BOTHER ME"
One student asked a question on the first project, and he chewed him out in front of everyone.
No one has dared ask a question since.
The book has ten chapters, and we had ten projects and ten tests
Our projects have NOTHING to do with the material in the current chapter we are studying. Very frustrating.
We've had ten test. The tests also have very little to do with the material in the chapter it is for.
Each test has also had several questions where he gives code and we're supposed to tell what it outputs.
What can I say, I cheated. I cut and paste the code into my text editor. compile it, run it. enter the output on the test.
50% of the time he marks it wrong and claims a different output.
The book is Deitel's Small Java.
perhaps it would be a good book with a good instructor. It is not good for self study. I read a section many times, just to figure out what it is saying. Way too much needless prose. One of my biggest frustrations, is it will use terminology in Chapter 3, that it doesn't introduce until Chapter 8. I spent a large amount of time skipping through the book trying to figure out what it was talking about. I also bought JAVA for Dummies as a "Desk reference". The text will spend lot's of pages on a concept, and thouroughly muddy it. At least with Dummies, I can clarify it to a couple of paragraphs.
I can see that if an instructor lectured, covering the high points of each chapter, then used assignments and projects from that chapter, it could have potential.
Reading other threads, I find that the JAVA I am learning, is not the practical stuff I will be able to use. For our projects, the instructor fleshes out our programs with psuedo code, and we complete the programming. I've become good at translating, pseudo code to JAVA, but that is NOT JAVA programming, and I don't feel comfortable writing anything much more complicated than "Hello World", 5 months and $1000 later. We've not even mentioned graphics.
I also see where Deitel's website lists the book as having 900+ pages, our text is much smaller, and I suspect a Readers Digest version.
I've also located our "projects", and find they are in Dietel's C++ text.
I feel like I'm reading a text translated from a foriegn language, with projects adapted from a totaly different text for a different programming language.
I DID learn enough to know I want to actually learn JAVA.
I turn in this project, and take my final, then I am done with this stage. Next week, I'll look through the book reviews here again, but I think I'll get HeadFirst, and self study my way through it. Someone's also suggested Thinking In Java.
Thanks again for everyone's help. And as I actually start LEARNING JAVA this summer, I'm sure I'll be back often with questions.
Joined: Oct 13, 2005
Sorry to hear about your troubles. I like Deitel myself, but I stick to the full-size editions which stretch to 1500 pages, but I know there are many people who absolutely detest the Deitel style. And as for the exercises, the Deitel books all have the same exercises in the back! Dummies (is that Barry Burd?) doesn't go into object-orientation enough for my likings, but Burd is very good at explaining how little bits of syntax work.
If you haven't found out yet how helpful people are here, you soon will