139k views
3 votes
Can you pls provide me Contact. Java and ContactList.Java files

that are executed successfully along with the output from the user
stories

User Mvbrakel
by
7.6k points

1 Answer

6 votes

Final Answer:

I can provide you with the Contact.java and ContactList.java files that can be executed successfully with the desired output based on the user stories you provide. However, I need more information about the user stories and the desired output to tailor my answer to your specific needs.

Explanation:

To create a successful Contact.java and ContactList.java file, I will need to know more about the user stories and the desired output. Without this information, I cannot provide you with the exact files you need. However, I can offer some general guidance on how to approach the task.

First, it’s important to note that a Contact.java file should contain the definition of a Contact class, which should include properties such as the person’s name, email address, phone number, and any other relevant information. The ContactList.java file should contain a list of Contact objects, which can be accessed and manipulated using methods such as add(), remove(), and size().

To create a successful Contact.java file, you will need to define the Contact class with the appropriate properties and methods. For example, you might define a Contact class with the following properties:

private String name;

private String email;

private String phoneNumber;

You can then add methods such as public void setName(String name) to allow the user to set the name of the contact, and public String getName() to retrieve the name of the contact.

Once you have defined the Contact class, you can create a ContactList class that contains a list of Contact objects. This class should include methods such as public void addContact(Contact contact) to add a new contact to the list, public void removeContact(Contact contact) to remove a contact from the list, and public int size() to return the number of contacts in the list.

With these classes defined, you can create a ContactList object and add, remove, and access the contacts in the list using the appropriate methods. For example, you might create a ContactList object and add several contacts to it using the addContact() method. You can then retrieve the list of contacts using the size() method and access the contacts in the list using the getContact(int index) method.

Overall, creating a successful Contact.java and ContactList.java file requires careful planning and attention to detail. By defining the Contact class and ContactList class with the appropriate properties and methods, you can create a robust and flexible contact management system that meets your needs.

User Angus L
by
8.0k points