Re: Singly Linked LIst and Objects Newbie Question
- From: Taria <mchew02@xxxxxxxxxxx>
- Date: Sun, 30 Sep 2007 12:03:26 -0700
On Sep 30, 6:51 am, Lew <l...@xxxxxxxxxxxxx> wrote:
Philipp Leitner wrote:
I might be missing something totally obvious here, but where in your
code are you setting the 'head' of the list? This is something that
should probably go into the block where you check for the 'first
value'.
Ok, I did that but by doing so, I had to change the private access of
head to protected for it to work. At this point, I'm unsure and too
tired to think whether this is accepted for the 'data hiding' theory
part of Javs. Professors are adamant throughout my courses that
everytihng is declared as private.
Another sidenote: you should stick to the standard conventions of CS,
like that the first element of a list has the index '0', not '1' as in
your case (see for instance arrays, the java.util collections, ...)
What do you mean by "CS"?
I think he means: CS = computer science.
To the OP: your main() method ought to do something to display or otherwiseprove that the contents of your list are what you expect them to be.
--
Lew
Noted...the next time I post something of this nature, I shall include
external debugging statements within the code.
Thanks guys, for your input. :)
-t
.
- References:
- Singly Linked LIst and Objects Newbie Question
- From: Taria
- Re: Singly Linked LIst and Objects Newbie Question
- From: Philipp Leitner
- Re: Singly Linked LIst and Objects Newbie Question
- From: Lew
- Singly Linked LIst and Objects Newbie Question
- Prev by Date: Re: Singly Linked LIst and Objects Newbie Question
- Next by Date: Re: Cannot find symbol java error (newbie question)
- Previous by thread: Re: Singly Linked LIst and Objects Newbie Question
- Next by thread: do I need "volatile" for HashMap? when I apply ReentrantReadWriteLock on it.
- Index(es):