Java help


Joined
Feb 17, 2011
Messages
1
Reaction score
0
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);
}
 
Ad

Advertisements


Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top