抽象类名作为形参和返回值(Abstract class name as formal parameter and return value)

package com.daxing_01;public class Cat {    public void eat() {        System.out.println("猫儿爱吃鱼!");    }}
package com.daxing_01;//操作类public class CatOperator {    public void uesCat(Cat c){        c.eat();    }}
package com.daxing_01;public class CatDemo {    public static void main(String[] args) {        CatOperator co = new CatOperator();        Cat c = new Cat();        co.uesCat(c);    }}运行结果:

猫儿爱吃鱼!

Process finished with exit code 0

————————
package com.daxing_01;public class Cat {    public void eat() {        System.out.println("猫儿爱吃鱼!");    }}
package com.daxing_01;//操作类public class CatOperator {    public void uesCat(Cat c){        c.eat();    }}
package com.daxing_01;public class CatDemo {    public static void main(String[] args) {        CatOperator co = new CatOperator();        Cat c = new Cat();        co.uesCat(c);    }}运行结果:

Cats love fish!

Process finished with exit code 0