This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Agile 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