Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

2 General Questions About Interfaces

 
Gary Farms
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Java supplied packages contain interfaces. An example is the Runnable interface in the java.lang package.
Q1) How Do I Go About finding out the names of all Java supplied
interfaces, and in what packages they are contained in?
Q2) If I create my own unique interface, where would I normally
put the interface definition (the method I'm calling with no
code body)? Must it be put in a package? If not, where else?

 
Cindy Glass
"The Hood"
Sheriff
Posts: 8521
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The dicision on what package to put a class or interface in is exactly the same sort of decision as you make when you decide how to organize the directories on your C: drive. Some organization that makes sense to you. If you are a sloppy housekeeper you will probably just keep them all jumbled in main classpath directory.
Interfaces are all listed in the API in italics. Click on any one and it will show you what package that Sun decided to put it in.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic