Classes, Part 2: CS 310 Lecture notes

Object-Oriented Programming with Java Lecture Notes

5 February 2009 • Classes, Part 2


Default packages have no name; there’s no way to refer to them outside the default package; the notation .C2 is syntactically incorrect and the notation C2 directs the compiler search the referring class’s package.

Note that each package directory contains a default package. However, these individual default packages don’t accumulate into a global default package. The entries in the class path will direct the compiler’s attention to particular directories, but without package-directory names, the compiler doesn’t know what to do next.


This page last modified on 24 January 2006.