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 it? 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 compile? Any examples of a simple interface implementation would also be very helpful. Thanks!
posted 14 years ago
Since this is a duplicate, I am closing it.
"JavaRanch, where the deer and the Certified play" - David O'Meara