[JAVA rookie] on the problem of parameters passed by inherited constructors.

The

code is as follows:

abstract class Animal {
    int age;
    public Animal() {};
    public Animal(int age) {
        this.age = age;
    }
}

class Bird {
    public Bird(int age) {
        super(age);
        System.out.println("");
        System.out.println("" + age + "");
    }
}

class Fish {
    public Fish(int age) {
        super(age);
        System.out.println("5");
        System.out.println("" + age + "");
    }
}

public class Test {
    public static void main(String[] args) {
        Bird bird = new Bird();
        Fish fish = new Fish();
    }
}

the execution result is as follows:

clipboard.png

I don"t see what"s wrong with the program. I passed 1 when I passed the value, how can I say I don"t have parameters?

Jun.18,2021

you didn't write extends
class Fish extends Animal {.}

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1eaf564-2249.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1eaf564-2249.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?