This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes Interface Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Interface" Watch "Interface" New topic


Saurabh Saha
Ranch Hand

Joined: Dec 08, 2004
Posts: 52
Hi All,
Please tell me can we create object of interface.

kashif hameed

Joined: Jun 15, 2003
Posts: 15
There is no way to create the instence of Interface.
Arundhathi Menon
Ranch Hand

Joined: Jan 14, 2004
Posts: 113
You could create a class that implements that interface and hence use that class's objects to access its methods.

Nikhilesh Fonseca
Ranch Hand

Joined: Aug 23, 2004
Posts: 57
Hey !!
You could consider an Interface to be like an abstratct class
that is a class which cannot be instantiated since it has methods which have to be implemented in some other class which extends it.
If you recall a class which does not implement all the methods of an interface itself becomes an abstratct clss .
I hope this is clear ..
Saurabh Saha
Ranch Hand

Joined: Dec 08, 2004
Posts: 52
Thanks to All.
now it's clear to me that we can't create instance of interface.

I agree. Here's the link:
subject: Interface
Similar Threads
How To Call Two Different Classes From the Main Program Using the Same API?
Home interface or Home Interface stub
Time Capsule
Writing an Interface
Regarding Interfaces