Hello, Im new to this site and java programming so I hope I am asking the question at the right forum page.
I am trying to add 2 variables in addEntry, but i keep getting
"cannot find symbol - method add(java.lang.String,int); maybe you meant: add(String) or add(int, String)
I hope you could help me with this
.
public class Entry
{
// storage of entries
private ArrayList<String> entries;
/**
* Constructor for objects of class Entry
*/
public Entry()
{
entries = new ArrayList<String>();
}
/**
* Store an entry.
*/
public void addEntry(String names, int phoneNumber)
{
entries.add(names, phoneNumber);
}
I am trying to add 2 variables in addEntry, but i keep getting
"cannot find symbol - method add(java.lang.String,int); maybe you meant: add(String) or add(int, String)
I hope you could help me with this
public class Entry
{
// storage of entries
private ArrayList<String> entries;
/**
* Constructor for objects of class Entry
*/
public Entry()
{
entries = new ArrayList<String>();
}
/**
* Store an entry.
*/
public void addEntry(String names, int phoneNumber)
{
entries.add(names, phoneNumber);
}