Passing in a sub-class to a method but having the super class as the parameter?

前端 未结 2 494
余生分开走
余生分开走 2021-02-01 03:41

I have an abstract class Vehicle with 2 implemented subclasses RedVehicle and YellowVehicle.

In another class I have a List

2条回答
提交回复
热议问题