Click here to Skip to main content
15,879,535 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
I understand that webdriver is an interface of which driver is a reference variable. But in Java the reference variable is not properly defined. It holds a reference the object. It does not hold the memory address of the object but a reference. Now webdriver is an interface and it's refernce variable is driver which will refer the object of Chrome driver. So if it is only going to point to the chromedriver, then a chromedriver object refernce can do that. It's not like it will hold the properties of webdriver interface, chrome driver class is already doing that.

What I have tried:

Can someone explain this concept to me and please don't post interface or top casting links? I am aware that this is top casting i am just trying to understand the purpose of this line here.
Posted
Comments
Richard MacCutchan 8-Jun-21 3:52am    
"But in Java the reference variable is not properly defined."
What reference are you talking about? And in simple terms a reference is the memory address of the object.
Ritika Dhar 8-Jun-21 4:32am    
Object Reference variable does not directly hold the memory address of the object that is no where specified it refers to the object.
Richard MacCutchan 8-Jun-21 4:43am    
And what exactly is a reference?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900