类名作为形参和返回值:
方法的形参是类名,其实需要的是传入该类的对象;
方法的返回值是类名,其实需要的是返回该类的对象;
抽象类作为形参和返回值: 抽象类不能实例化,只能通过子类实例化对象。
方法的形参是抽象类名,其实需要的是传入该抽象类的子类对象;
方法的返回值是抽象类名,其实需要的是返回该抽象类的子类对象;
接口名作为形参和返回值:接口不能实例化,只能通过实现类实例化对象。
方法的形参是接口名,其实需要的是传入该接口的实现类对象;
方法的返回值是接口名,其实需要的是返回该接口的实现类对象;