This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan 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 Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Interface" Watch "Interface" New topic
Author

Interface

Saurabh Saha
Ranch Hand

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

Thanks,
Vivek
kashif hameed
Greenhorn

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
Hi!
You could create a class that implements that interface and hence use that class's objects to access its methods.
regards
Menon


SCJP , SCWCD , SCBCD , SCDJWS
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
Hi,
Thanks to All.
now it's clear to me that we can't create instance of interface.

Vivek
 
 
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