This week's book giveaway is in the OCPJP forum. We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line! See this thread for details.
What is the command (to be used in DOS) to see what classes are available in a particular package, for instance, assume I want to see what classes are stored in java.util package. What is the command I should use?
Are you looking in a .jar? You know that any program which inflates a .zip file will inflate a .jar too; they use virtually the same format? When you have inflated the .jar into folders, use, "cd java, cd util, dir."
You can also find the details of the classes from the standard Java API documentation. Find the overview page with frames, and click on the nams of the package at the top left.
Corrected anme of package[/edit] [ February 02, 2008: Message edited by: Campbell Ritchie ]
It is impossible to find out all the classes that could possibly be loaded, in a given package, as ClassLoaders do not have to provide enumeration facilities. Also, of course, additional ClassLoaders can be activated at any time, potentially making more classes available.
The above restriction makes sense, if you think about it, but more surprising to me is that you can't easily list all the loaded classes, either. (Or can you?).
If you know all your classes will be loaded by the system ClassLoader, then you can examine the classpath (it's a system property) and then read the directories and Jars to find all the classes.
Betty Rubble? Well, I would go with Betty... but I'd be thinking of Wilma.