Hello,
is there anyone who will help me with printing all 10 object, each in new line?
package pl.codegym.task.task06.task0614;
import java.util.ArrayList;
import java.util.List;
import static java.lang.System.*;
/*
Statyczne koty
*/
public class Kot {
public static ArrayList<Kot> koty = new ArrayList<Kot>();
//tutaj wpisz swój kod
public Kot() {
}
public static void main(String[] args) {
Kot [] kot =new Kot[10];
int x = 0;
while (x<10){
kot[x]= new Kot();
koty.add(kot[x]);
x++;
}
//tutaj wpisz swój kod
printKoty();
}
public static void printKoty() {
System.out.println(koty);
//tutaj wpisz swój kod
}
}