polymorphism in object oriented programming code example

Example 1: what is polymorphism

The word polymorphism means having many forms. In simple words, we can define polymorphism as the ability of a message to be displayed in more than one form. Real life example of polymorphism: A person at the same time can have different characteristic. Like a man at the same time is a father, a husband, an employee.

Example 2: polymorphism in framework

HOW DO YOU IMPLEMENT POLYMORPHISM IN YOUR FRAMEWORK

Set<Integer> set1 = new HashSet<>();
Map<Integer> set2 = new HashMap<>();
List<Integer> mySet = new ArrayList<>();

JavaScriptExecuter js = (JavaScriptExecuter)Driver.getDriver;
TakeScreenshot screen = (TakeScreenshot)Driver.getDriver;

WebDriver driver = new ChromeDriver();
WebDriver driver = new FirefoxDriver();

AppiumDriver driver = new AndroidDriver();