import java.util.ArrayList;
import java.util.Collections;
public class PersonMaker

    public static void main(String[] args) 
        ArrayList<Person> personAL = new ArrayList<Person>();

        ArrayList<Address> addressList = new ArrayList<Address>();
        Address c0 = new Address("2100 Pleasant Hill road", "duluth", "GA", "30096");
        Address c1 = new Address("3392 fairway oaks", "lawrenceville", "Georgia", "30044");
        Address c2 = new Address("4493 Pleasant hill road", "Duluth", "Georgia", "30096");

        ArrayList<Phone> phoneAL = new ArrayList<Phone>();
        Phone d0 = new Phone(404, "9932116");
        Phone d1 = new Phone(678, "4432423");
        Phone d2 = new Phone(470, "4432423");



my question is Construct 3 people with different addresses and phone numbers (do not generate the data)
Add them to an array list of Person
Sort each of the people’s addresses and phone numbers (Collections.sort for the address and
phone array lists)

and i am getting error i dont know if i am doing it wrong or it just an error

shouldn't address and phone number be fields of the person class?


Then if you want to have your objects in the arraylist
person1 = new Person(name,age,address,phonenumber)
person2 = new Person(name,age,address,phonenumber)
person3 = new Person(name,age,address,phonenumber)
commented: That's right. +15

"I am getting error" ...
do you think you can be a bit more specific on that part?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.19 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.