its not compiling plz check it ?
note:AddressBook.java uses unchecked or unsafe operation
note:recompile with -Xlint :unchecked for details
is the error in the following code plz solve this problem for me
import javax.swing.*;
import java.util.*;
public class AddressBook
{
private ArrayList persons;
public AddressBook()
{
persons=new ArrayList();
}
public void add()
{
String s1=JOptionPane.showInputDialog("enter the Name please");
String s2=JOptionPane.showInputDialog("enter the Address please");
String s3=JOptionPane.showInputDialog("enter the Phone Number please");
PersonInfo p=new PersonInfo(s1,s2,s3);
persons.add(p);
}
public void searchByName(String n)
{
for(int i=0;i<persons.size();i++)
{
String s1=JOptionPane.showInputDialog("enter the Name to be search please");
PersonInfo p=(PersonInfo) persons.get(i);
String g=p.getname();
if (g.equals(n))
{
p.print();
}
}
}
public void delete()
{
String s1=JOptionPane.showInputDialog("enter the Name to be deleted please");
for(int i=0;i<persons.size();i++)
{
PersonInfo p=(PersonInfo) persons.get(i);
String g=p.getname();
if (g.equals(n))
{
persons.remove(i);
}
}
}
}>

