Untitled

mail@pastecode.io avatar
unknown
plain_text
2 years ago
466 B
2
Indexable
Never
import java.util.ArrayList;
import java.util.List;

public class Main {
    public static void main(String[] args) {
        List<Peto> peterson = new ArrayList<>();

        for (int i = 0; i < 10; i++) {
            Peto.setAge(i);
            Peto peto = new Peto(Peto.getAge());
            peterson.add(peto);
         
        }
        for (int i = 0; i < 10;i++){
            System.out.println(peterson.get(i).toString());
        }
    }
}