We can create a driver object using the following ways.
WebDriver driver = new FirefoxDriver();
FirefoxDriver driver = new FirefoxDriver();
FirefoxDriver is a class that is implementing WebDriver Interface.
In the first statement we are using the interface name and in the second one we are using class name. Is there any difference between the two like we can't access some methods etc.?
I looked for this question on stackoverflow and found that first one is dynamic binding and second one is static binding but is there any real difference between the two declarations above?
If we don't have any difference why we should have two declarations?
Can someone answer this please?
Thank you.