Abstract
Let’s consider a simple scenario. Can you use the same name for different classes in a Java file? No. The compiler would raise an issue and would point toward this naming collision. When you define a class, you need to follow unique naming conventions. In real-world programming, class names should be somewhat meaningful, and there is the possibility that different programmers will opt for class names that are not unique. Then the obvious question is: how can you deal with such situations? Packages can rescue us in these instances.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Author information
Authors and Affiliations
Rights and permissions
Copyright information
© 2020 Vaskaran Sarcar
About this chapter
Cite this chapter
Sarcar, V. (2020). Packages. In: Interactive Object-Oriented Programming in Java. Apress, Berkeley, CA. https://doi.org/10.1007/978-1-4842-5404-2_7
Download citation
DOI: https://doi.org/10.1007/978-1-4842-5404-2_7
Published:
Publisher Name: Apress, Berkeley, CA
Print ISBN: 978-1-4842-5403-5
Online ISBN: 978-1-4842-5404-2
eBook Packages: Professional and Applied ComputingApress Access BooksProfessional and Applied Computing (R0)