import java.util.ArrayList;
import java.util.List;

public class Sample5 {
    
    public static void main(String[] args) {
        List<Smartphone> list = new ArrayList<>();
        Smartphone phone1 = new Smartphone("ABC", 35000);
        Smartphone phone2 = new Smartphone("XYZ");
        list.add(phone1);
        list.add(phone2);
        
        System.out.println("size = " + list.size());
        for (int i = 0; i < list.size(); i++) {
            Smartphone phone = list.get(i);
            phone.print();
        }
        
        list.remove(1);
        
        System.out.println("size = " + list.size());
        for (int i = 0; i < list.size(); i++) {
            Smartphone phone = list.get(i);
            phone.print();
        }
        
        list.add(0, new Smartphone("PQR", 20000));
        
        System.out.println("size = " + list.size());
        for (int i = 0; i < list.size(); i++) {
            Smartphone phone = list.get(i);
            phone.print();
        }
    }
}
