class as nested class inside the definition of the text editor class keeps these two highly related classes together in the same file moreoverit also allows each of them to access nonpublic methods of the other one technical point regarding nested classes is that the nested class should be declared as static this declaration implies that the nested class is associated with the outer classnot an instance of the outer classthat isa specific object packages set of classesall defined in common subdirectorycan be java package every file in package starts with the linepackage package_namethe subdirectory containing the package must be named the same as the package we can also define package in single file that contains several class definitionsbut when it is compiledall the classes will be compiled into separate files in the same subdirectory in javawe can use classes that are defined in other packages by prefixing class names with dots (that isusing the characterthat correspond to the other packagesdirectory structures public boolean temperature(ta measures thermometer thermometerint temperature/the function temperature takes class thermometer as parameter thermometer is defined in the ta package in subpackage called measures the dots in ta measures thermometer correspond directly to the directory structure in the ta package all the extra typing needed to refer to class outside of the current package can get tiring in javawe can use the import keyword to include external classes or entire packages in the current file to import an individual class from specific packagewe type the following at the beginning of the fileimport packagename classnamesfor examplewe could type