DeAndrea said:
I have downloaded it now and I'm not having problems using it.
However, I keep getting the same error saying cannot find symbol and
it all starts with me declaring the linkedlist name as phone. The
program isn't recognizing the name and anytime it is used throughout
the program it doesn't work. It tells me to creat a class named phone
but that doesn't make sense to me because all of the code is supposed
to be included in a linkedlist.
See comments below.
[ SNIP ]
I'm kind of confused as to what's supposed to be done here. I've used
Java in previous classes but never this intense. I'm a lot more
comfortable with Ruby but I don't have an option to use it here.
Now that you're in NetBeans (abbrev. NB) don't worry about the command-line
stuff I described. However, certain immediate points come to mind:
1) I still strongly recommend putting your classes in a package;
2) method definitions don't have a ; right after the signature. It's
public void foo() {
// stuff
}
not
public void foo();
{
// stuff
}
3) I wouldn't be using static methods here but this may be where you guys
have gotten to in instruction; I'll leave it at that. However, it does mean
if you want to have the "phone" variable, a LinkedList, visible to your
static "operations" methods, that you need to have a class variable instead,
basically a
private static LinkedList phone;
declaration at the top-level of the class (not inside a method, including
main()).
4) There are a number of other syntax issues, like erroneous method
signatures, but once you've cleared up the above you should find those
straightforward to solve.
As to your design question, think of it like this: your "phone directory" is
stored as a LinkedList which is referenced by the "phone" variable in your
PhoneDir class. Down the road, if you move away from statics, you'd most
likely have an *instance* of the PhoneDir class, which internally has a
reference still to a LinkedList.
For what it's worth, given the stage of Java that you are at, I commend you
on the clarity and structure of your code. I have to *work* with people,
intermediate and senior developers some of them, that could take some
pointers from you.
AHS