Can you give me a sample java program on how to create an addressbook?
-
Creating An Addressbook through Java Programming
-
Answer:
you need two things - an object for records, and an object for the whole addressbook. for records ie class Record { String name; String address; ... more fields } add fields as you see fit. for the addressbook, use ArrayList ie class AddressBook { private ArrayList<Record> list; public void insertRecord(Record rec) { blahblahblah } ...more methods } so basically, your Record holds one persons data, and AddressBook holds all Records, knows how to insert, delete, find them etc. your main program should have one instance of AddressBook, and should be responsible for user interface (ie reading from a keyboard or GUI) you also might want to add method to the Record class that would know if two records are similar (for searching - when searching you enter a new Record, and your AddressBook returns all records that are similar ie you entered first couple of letters of a name, and AddressBook should return all Records that have the string in them)
yedda at Yahoo! Answers Visit the source
Related Q & A:
- Can anyone give me a brief description of tourism in Tamil Nadu, India?Best solution by Yahoo! Answers
- Can anyone give me a list of good metal bands?Best solution by nz.answers.yahoo.com
- Can someone give me a brief introduction to livejournal?Best solution by answers.yahoo.com
- Can you give me a sample of a recommendation letter?Best solution by Yahoo! Answers
- How is it like working as a paralegal? What advice can you give to a potential paralegal?Best solution by Ask.com old
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.