File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Beginning Java and the fly likes How Are Interfaces Implemented? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "How Are Interfaces Implemented?" Watch "How Are Interfaces Implemented?" New topic

How Are Interfaces Implemented?

Gary Farms
Ranch Hand

Joined: Jun 24, 2000
Posts: 57
I have questions concerning Java interfaces. They are:
Q1) Must an interface be defined in a separate .java file?
Q2) Can an interface be defined in the same class file that calls
Q3) Are interfaces used only for methods & data already
defined in Java supplied packages?
Q4) Aren't interfaces also used to stub methods which are
defined (but not yet written) in order to get a clean
Any examples of a simple interface implementation would also be very helpful. Thanks!
Cindy Glass
"The Hood"

Joined: Sep 29, 2000
Posts: 8521
Since this is a duplicate, I am closing it.

"JavaRanch, where the deer and the Certified play" - David O'Meara
I agree. Here's the link:
subject: How Are Interfaces Implemented?
It's not a secret anymore!