In editContact on the "[Contact.getName()]" I get the errors:
- Cannot make a static reference to the non-static method getName() from the type Contact
- Type mismatch: cannot convert from String to int
Why is this and how can I resolve the issue? thanks!
public class ContactList
{
private final int MAX_NUMBER_OF_CONTACTS = 100;
private Contact[] contactList = new Contact[MAX_NUMBER_OF_CONTACTS];
public void addContact(String contactName, String contactNumber,
String contactEmail, String contactAddress)
{
if (Contact.getContactCount() >= MAX_NUMBER_OF_CONTACTS)
{
System.err
.println("Eror: You have too many contacts, delete one of them you fool!");
return;
public int editContact(String contactToEdit)
{
if (editContact(contactToEdit) < 0)
{
return -1;
}
else
contactList[Contact.getName()].setName("");
contactList[Contact.getPhoneNumber()].setPhoneNumber("");
contactList[Contact.getEmail()].setEmail("");
contactList[Contact.getAddress()].setAddress("");
}
}