jQuery in Action, 3rd edition
The moose likes Beginning Java and the fly likes interface probelm? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "interface probelm?" Watch "interface probelm?" New topic

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;

here how is possible?

Maneesh Godbole
Saloon Keeper

Joined: Jul 26, 2007
Posts: 10828

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.

[How to ask questions] [Donate a pint, save a life!] [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.
I agree. Here's the link: http://aspose.com/file-tools
subject: interface probelm?
jQuery in Action, 3rd edition