Java – why shouldn’t we use the (default) SRC package?
•
Java
I recently started using the eclipse IDE and have read in many places that I shouldn't use the default (SRC) package and create a new package
Solution
Using the default package may create namespace conflicts Imagine that you are creating a library that contains the MyClass class Someone uses your library in his project and has a MyClass class in his default package What should the compiler do? A package in Java is actually a namespace that fully identifies your project Therefore, it is important not to use default packages in real - world projects
The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
二维码