I am novice to Java or Selenium.
I just need help to understand one basic question.
Why we assign firefoxdriver instance to WebDriver? WebDriver driver=new Firef
I know that this is kind of Late binding in Java,
No. This is an example of compile time binding. But yes, it's also an example of programming to the WebDriver
interface.
Question1: But this applies [sic] to classes, right?
It could (conceivably) be an interface that extends WebDriver
.
Question2: WebDriver is an interface, then can we create an object instance of an interface?
Yes, you can create concrete instances that implement an interface. In fact, to use any interface there must be at least one concrete implementation.