Main.java:16: error: non-static variable this cannot be referenced from a static context
animals[0] = new Animal();
^
Main.java:17: error: non-static variable this cannot be referenced from a static context
animals[1] = new Cat();
^
Main.java:18: error: non-static variable this cannot be referenced from a static context
animals[2] = new Dog();
^
Main.java:14: error: Illegal static declaration in inner class Ideone.AnimalTest
public static void main( String[] args ){
^
modifier 'static' is only allowed in constant variable declarations
4 errors