| Author |
interface probelm?
|
harsh garg
Ranch Hand
Joined: Jul 13, 2008
Posts: 33
|
|
we all know we cannot create the object for the interface,But during the database connectivity , we create the object for the interface...
Connection con;
Statement st;
Class.forName(driver);
con=DriverManager.getConnection("");
here how is possible?
|
 |
Maneesh Godbole
Saloon Keeper
Joined: Jul 26, 2007
Posts: 8439
|
|
Same way we can create
Actually what you are creating (by calling new) is a HashSet type of object, but since it is of the type Set, the above statement is legal.
|
[Donate a pint, save a life!] [How to ask questions] [Onff-turn it on!]
|
 |
amitabh mehra
Ranch Hand
Joined: Dec 05, 2006
Posts: 98
|
|
|
You can always assign object of child type into reference of parent type.
|
 |
 |
|
|
subject: interface probelm?
|
|
|