📜  如何在您的项目中使用抽象 - 无论代码示例

📅  最后修改于: 2022-03-11 14:59:08.226000             🧑  作者: Mango

代码示例1
I used in defining a common super class while writing POM layer of the framework
We usually create an abstract class named
BasePage to have all common members for every page written
in this class like getPageTitle().
Then each Page class (HomePage, LoginPage, DashboardPage
etc.) inherit from BasePage.
Sometimes one may need to change the behavior of methods
implemented in superclass. So, subclass has freedom to
override that method where we use polymorphism.
This is how we use Abstract class in real projects