PDA

View Full Version : java question, how do you interpret this question.



indigo0086
11-01-2006, 10:10 PM
I'm not asking for code, not asking for code help, but I can't even figure out what this question is asking me. For those familiar with java could you help me out.



The Collection interface in the Java Collections API defines methods removeAll, addAll, and containsAll. Add these methods to the Collection interface and provide implementations in AbstractCollection

the collections interface defindes the methods, but I have to add them? And AbstractCollection class already implements these methods because it implements the Collection interface. Is he asking me to create my own AbstractCollection class and implement these methods? Is it asking me to use the book's example which doesn't implement them? This book sucks, and I'm not fond of all these interfaces either.

CornedBee
11-02-2006, 03:21 AM
I think they want you to duplicate the code in the standard library.

indigo0086
11-02-2006, 09:24 AM
That's what I though, but this book is incredibly vague, a lot of the questions are very "open" in that they tell you what to do, but don't specifically tell you that you don't have to do it one way.

Prelude
11-02-2006, 09:48 AM
>a lot of the questions are very "open" in that they tell you what to do, but
>don't specifically tell you that you don't have to do it one way.
Sounds like my job.

indigo0086
11-02-2006, 09:51 AM
well, yeah, but the thing is like one question, it will give you a method header and tells you to use it to solve the problem. I'll spend all day until I learn that the method the way it's declared could not solve the problem, but it doesn't say to modify the header, it just lays it on you, telling you little else. For a programming exercise it's a little less focused. Maybe it's just me, I'll ask my professor later.

Prelude
11-02-2006, 10:12 AM
>but it doesn't say to modify the header, it just lays it on you, telling you little else
Most likely it's a poorly designed question, but I rather like the idea of problems that force you to think squiggly.

indigo0086
11-02-2006, 10:30 AM
yah, maybe the other teacher I have is right, he jokingly say this guy (a teacher at my university) wrote a book to get a younger wife or something like that.