Most asked top Interview Questions and Answers | Online Test | Mock Test
面向面试准备、在线测试、教程与实战练习的学习平台

通过聚焦学习路径、模拟测试和面试实战内容持续提升技能。

WithoutBook 将分主题面试题、在线练习测试、教程和对比指南整合到一个响应式学习空间中。

搜索资源库
面试准备

模拟考试

设为首页

收藏此页面

订阅邮箱地址

Question: What's the use of concrete methods in abstract classes?
Answer: One of the design principles of Java inheritance is to create superclass methods that can be used by one or more subclasses, this avoids duplication of code and makes it easier to amend. The same principle holds with abstract classes that are fulfilled by numerous subclasses.

One useful technique with abstract classes is that a concrete method may be defined in anticipation of abstract methods being fulfilled in its subclasses. In the example below the AbstractShape class has a concrete printArea() method that calls the abstract getArea() method. Subclasses inherit the printArea() method and must implement the getArea() method to stand as concrete classes.

保存以便复习

收藏此条目、标记为困难题,或将其加入复习集合。

打开我的学习资料库
Is it helpful? Yes No

Most helpful rated by users:

©2026 WithoutBook