ITI 1121 Lecture Notes - Lecture 3: Instance Variable, Access Modifiers, Class Variable

131 views3 pages

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.

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers

Related Documents