ITI 1121 Lecture Notes - Lecture 3: Instance Variable, Access Modifiers, Class Variable
Document Summary
A package is a group of one or more related classes. When java was downloaded, it came with the java api (application programming interface) that is structured into packages, such as: java. awt java. swing java. util java. lang. Packages can contain other packages, but there"s not usually a point in doing this in self-created packages. The import keyword is used to import specific java packages. ie. import java. awt. the . * imports all types in the java. awt package, but not the packages within java. awt such as java. awt. color or java. awt. font to access these packages you have to import both: import java. awt. import java. awt. color. ^ we"ll use these packages a lot when we get into gui (graphical user interface) If you want to import a specific class, you have to use the complete name of a class in the package, like: packagename. classname. A class has access to and is only visible to the other classes in the same package.