This week's book giveaway is in the OCPJP forum.
We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line!
See this thread for details.
The moose likes Game Development and the fly likes Creating an instance to an interface Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Java » Game Development
Bookmark "Creating an instance to an interface" Watch "Creating an instance to an interface" New topic
Author

Creating an instance to an interface

SN Ayyappan
Greenhorn

Joined: Dec 24, 2007
Posts: 3
Hi,,, Can i able to create an instance to an interface. Please help me in this regard........
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42363
    
  64
You can only create instances of classes, not of interfaces. You can create an instance of an anonymous class that implements an interface, though. Something like this:


Ping & DNS - my free Android networking tools app
 
jQuery in Action, 2nd edition
 
subject: Creating an instance to an interface