• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How Are Interfaces Implemented?

 
Gary Farms
Ranch Hand
Posts: 57
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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!
 
Cindy Glass
"The Hood"
Sheriff
Posts: 8521
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Since this is a duplicate, I am closing it.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic