COMPSCI 61B Lecture Notes - Lecture 15: Gradle

46 views4 pages

Document Summary

To address the fact that classes might share names: A package is a namespace that organizes classes and interfaces. Naming convention: package name starts with website address (backwards) If used from the outside, use entire canonical name. If used from another class in same package, can just use simple name. At the top of every le in the package, put the package name. Make sure that the le is stored in a folder with the appropriate folder name. For a package with name ug. joshh. animal, use folder ug/joshh/animal. To use a class from package a in a class from package b, use the canonical name. By using an import statement, we can just use the simple name instead. Any java class without a package name at the top are part of the default package. In other words, from now on, when writing real programs, your java les should always start with a package declaration.

Get access

Grade+
$40 USD/m
Billed monthly
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
10 Verified Answers
Class+
$30 USD/m
Billed monthly
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
7 Verified Answers

Related Documents