The professional, friendly Java community. 21,500 members and growing!

The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.

Re: HELP!!! Entry Class to represent entries in a telephone directory

You are most definitely on the right track there. There might be other appropriate constructors that you could create as well, maybe one that takes a name and a phone number only because some people might not want to have their address listed for instance.

You also need to add the setter methods for name, address and phone number.

public void setName(final String name) {
this.name = name;
}

This way you can change the data of one entry even after you have created the object.

I think you might be missing a closing bracket for the main method as well.

Re: HELP!!! Entry Class to represent entries in a telephone directory

@Chris, Hiiii, Yes another Bangor University Student how did you guess? My name is Dana

Easy, i've seen a few people post this assignment and beleive it or not I have had to do it myself lol! At least you are admitting you are from bangor and not being afraid of the fact someone found them out. Unfortunately I can't really help for fear of braking some form of plagurism, if thats how you spell it

I also see you're an avid web developer, might i ask is the web developer or web designer?

Of course make sure you look at all the requirements for this entity.
Will you need to be able to look up numbers by different parts? In the US we have Country-Area-Nxx-#### format of our numbers - so the PhoneNumber field as a single string is only usable for output. In our code we actually store country, area and the nxx-#### separate in our database and have to make sure our entities understand that.
Also, typically we have to separate names in First, Middle, Last, Title, etc... but this is probably beyond the scope of your assignment. Many years of working on CRM apps have made me overly detailed about this stuff! Hope this help!

Re: HELP!!! Entry Class to represent entries in a telephone directory

How would you break the form of plagurism? Im not asking you to do it lol just asking for a bit of help which is allowed Anyway I've managed to do it now with the help from Java Enterprise LOL! What year you in? And what you studying?

Yeah I am Web Developer and Web Designer it is my main field of interest! I was suppose to be at Manchester studying Web Development but due to family problems had to transfer to Bangor for a bit

Re: HELP!!! Entry Class to represent entries in a telephone directory

While we are on the subject of phone numbers, there is only one way that these should be stored and that is as a string with numbers only. No spaces, no dashes no nothing, just numbers, maybe even with country code at the beginning.