public class BusOnStreet extends Street{
public void run(){System.out.println("公共汽车在街道上行驶");}
}
传统做法通过继承来实现
结构图: