I am working on a class for an Address Book Application on Java called "AddressBook.java", which I have written the following code:
package com.company;
import java.util.ArrayList;
class AddressBook {
ArrayList<AddressEntry> addressEntryList = new ArrayList<AddressEntry>();
AddressEntry test = new AddressEntry("john", "doe", "yes", "no", "maybe", 1, "I guess", "ok");
addressEntryList.add(test);
}
Since I was just testing the test object, I had to give random values for the variables from my AddressEntry class and it seemed to work well. However, when I ran it in IntelliJ, I received the error
Cannot resolve symbol 'add'
This made the adding method not working.
mainmethod: docs.oracle.com/javase/tutorial/java/concepts/class.html