This week's book giveaway is in the OCMJEA forum.
We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara 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 OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA 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
 
Consider Paul's rocket mass heater.
 
subject: Interface