nested classes and packages the java language takes general and useful approach to the organization of classes into programs every stand-alone public class defined in java must be given in separate file the file name is the name of the class with java extension so classpublic class smartboardis defined in filesmartboard java in this sectionwe describe two ways that java allows multiple classes to be organized in meaningful ways nested classes java allows class definitions to be placed insidethat isnested inside the definitions of other classes this is useful constructwhich we will exploit several times in this book in the implementation of data structures the main use for such nested classes is to define class that is strongly affiliated with another class for example