package com.codegym.task.task06.task0614;
import java.util.ArrayList;
import java.util.Arrays;
/*
Static cats
*/
public class Cat {
//write your code here
public static ArrayList<Cat> cats = new ArrayList<>();
public Cat() {
}
public static void main(String[] args) {
//write your code here
for(int i=0; i<10; i++){
Cat cat = new Cat();
cats.add();
}
printCats();
}
public static void printCats() {
//write your code here
System.out.println(Arrays.toString(cats));
}
}
package com.codegym.task.task06.task0614;
import java.util.ArrayList;
/*
Static cats
*/
public class Cat {
//write your code here
public static ArrayList<Cat> cats = new ArrayList<Cat>();
public Cat() {
}
public static void main(String[] args) {
//write your code here
for(int i=0; i<10; i++){
Cat cat = new Cat();
cats.add(cat);
}
printCats();
}
public static void printCats() {
//write your code here
System.out.println(cats);
}
}