В чем ошибка?
package com.javarush.task.task07.task0726;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.io.CATS;
/*
Не компилируется задача про котиков
*/
public class Solution {
public final static ArrayList<Cat> CATS = new ArrayList<>();
public static void main(String[] args) throws IOException {
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
while (true) {
String name = reader.readLine();
if (name == null || name.isEmpty()) {
break;
}
String age = reader.readLine();
int n1 = Integer.parseInt(age);
String weight = reader.readLine();
int n2 = Integer.parseInt(weight);
String tailLength = reader.readLine();
int n3 = Integer.parseInt(tailLength);
Cat cat = new Cat(name, n1, n2, n3);
CATS.add(name);
CATS.add(n1);
CATS.add(n2);
CATS.add(n3);
}
printList();
}
public static void printList() {
for (int i = 0; i < CATS.size(); i++) {
System.out.println(CATS.get(i));
}
}
public static class Cat {
private String name;
private int age;
private int weight;
private int tailLength;
Cat(String name, int age, int weight, int tailLength) {
this.name = name;
this.age = age;
this.weight = weight;
this.tailLength = tailLength;
}
@Override
public String toString() {
return "Cat's name: " + name + ", age: " + age + ", weight: " + weight + ", tail: " + tailLength;
}
}
}