Simple Address Book Program In Java

/ Comments off
Simple Address Book Program In Java

Simple address book using AWT. Write some very simple, book name, simple telephone program, java swing gui, class full address, using program java. Introduction What you will Find Here. This page is the starting point into a series of pages that attempt to give a complete example of object-oriented analysis.

Examples Of Java Program

Simple Address Book Program In Java

Can u give me some code that helping me making simple addressbook? Thats have output attributes description name address telnum email add using util scanner and provide nesscesarry accessor and mutator methods all the attributes and creating object provide add entry, delete entry view entries, update entry Start a new thread with your question and your code. As far as your question: since you posted in this thread, you should have read it and saw that your question has been answered.

Java Simple Programs For Beginners

This thread has the code and examples that you need to get you started.

@JohnAdams: I liked your persist class - it's exactly what I would do for this. Serializing application state to disk is entirely adequate if you don't need share that data with other applications. Putting this into a database for example, would be over-engineering (not 'agile'). I just noticed there is probably an error in the readAddressBooks method because you are declaring a local variable called addressBooks which is hiding the class field of the same name.

Based on how the rest of the code in that clThe readAddressBooks should set the class member instead. – Aug 22 '13 at 14:33. I would use a Set in the AddressBook class. This way there cannot be any duplicates. A AddressBook is more like a Set than a List.

If you want it sorted by name you can use a TreeSet. Union, intersection and difference can be implemented quite easy: Set union = new HashSet(s1); union.addAll(s2); Set intersection = new HashSet(s1); intersection.retainAll(s2); Set difference = new HashSet(s1); difference.removeAll(s2); You can use these to simplify your getUniqueContacts(.) method a lot.

I want to notice that the TreeSet-implementation violates the Liskov-Substitution-Principle. Furthermore It breaks the contract of the Set interface.

Sets and order are not semantically compatible. As I would use a Set-Implementation too I would go with HashSet. But I would argue otherwise: Sure you can enforce uniqueness even if you try to add an object that is already present. But that is not the value.

The value is the message to other developers that they get a collection with some assertions. – Feb 5 '17 at 8:37.