I have a doubt about interfaces.
I have seen some code,they are writing
Connection con = Drivermanager.getConnection("URL","User name","Pwd");
here con (reference varible of Connection Interface ) holding Oracle Connection Object. since we know that we are creating Oracle Connection Object why cant we write
OracleConnectionClass Oraclecon = Drivermanager.getConnection("URL","User name","Pwd");
if i asked some people they say that ,they are achieving polymorphism,by using Connection Interface.
But,
what is the use.
we can do
create statement,execute query.. etc by both references (con and Oraclecon).
simillarly for List and ArrayList
Thanks in advance