gpt4 book ai didi

java - java中如何使用接口(interface)实现抽象

转载 作者:行者123 更新时间:2023-11-29 05:17:35 26 4
gpt4 key购买 nike

<分区>

我知道

Abstraction is process of hiding the implementation details and showing only the functionality.

但是通过使用接口(interface)我们不能实现任何东西。我们还需要实现的类开发应用程序。例如在java中我们有List接口(interface),它有像LinkedList和ArrayList这样的子类。他们也提供了这些类的代码。我们能够看到那些实现代码的代码。谁能给我一个例子抽象。

如果我只把接口(interface)给某人,那么我就可以实现抽象。但是这有什么例子吗?

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com