"A package is a collection of classes and interfaces. Each package has its own name and organizes its top-level (that is, nonnested) classes and interfaces into a separate namespace, or name collection. Although same-named classes and interfaces cannot appear in the same package, they can appear in different packages because a separate namespace assigns to each package."
"No. volatile allows multiple threads to access the main-memory copy of a shared variable—not the working-memory copies (for those JVMs that use working memory). volatile does not allow several instructions to be treated as an indivisible unit, which is what synchronization accomplishes."
"Editor's note: Sometimes, the most interesting discussions begin when someone says, "This may be a stupid question, but ..." If the person asking the question has taken the time to think about the problem before asking, the question is often not stupid at all. Uncertainty points out an ambiguity in the specs, holes in the docs, or a search for how more experienced programmers might address a particular problem. From time to time, we will publish one of the "(Not So) Stupid Questions" we receive and invite our readers to answer the question in the feedback section."
"In the PackagesAccess/examples/ex1/com/artima/somelib directory of the example source code, edit SplitNameReturnVal.java. Make one small change to this file: change the access level on the class (SplitNameReturnVal) from public to package access."
"The fourth way to think about packages is as a tool that can help you separate interface from implementation. You can grant special access privileges between types within the same package, and you can declare entire types to be accessible only to other types within the same package. The full details of how to do this will be given later in this chapter as part of a discussion of Java's access levels."
"Yeah, it's kind of like friends in C++ -- you know, "only friends can access your private parts." In Java, classes can access the "protected" and "default" member functions and instance data of other classes in the same package (as well as the "public" members, naturally)."
"But packages do suck. The main reason they suck is a fairly confusing interaction between (a) the tight coupling between packages and directories, and (b) a design decision by the authors of javac. This article will help clear up this confusion and, hopefully, make you less intimidated, so you can feel comfortable using packages whenever you want."