//ArrayListEx(main class)
import java.io.*;
import man.Phone;
import man.Person;
import java.util.*;
public class ArrayListEx{
public static void main(String[] args){
Person p= new Person();
p.setName("yo");
ArrayList<Phone> pList = new ArrayList<Phone>();
Phone ph = new Phone();
ph.setOne("dasd");
pList.add(ph);
System.out.println("sgs "+pList);
}
}
My Program has a Person,Phone and ArrayListEx(main class) classes,Person contains an ArrayList<Phone> class but when printing the List of Phone from Person,the result is the address of the element instead of the actual element.
//Result:
sgs [man.Phone@4830c221]
Thanks.