解耦,然后提高代码的可用性和扩展性.
下面是面向接口和面向实现的java代码例子:
//面向接口 Animal dog = new Dog(); //面向实现 Dog dog = new Dog();
Powered by: 博客园 Copyright © 2024 lazycookie Powered by .NET 9.0 on Kubernetes