The beginning of an Oolong source file gives information about the class as a whole, including its name, superclass, and interfaces. The .class directive names the class .class public final foo/Bar The class name is a collection of words separated by forward slashes (/). Everything up to the last slash is called the package; everything after it is the class name. Throughout the virtual machine, only the fully qualified name (both the package and class name) is used. The Java import statement lets you refer to classes just by the class name. However, the JVM doesn't permit this, since it can lead to ambiguities. When a Java compiler turns the Java source into JVM bytecodes, it must figure out the fully qualified name before it builds the class file. The .class directive may also list some properties of the class. The keywords in Table 2.1 may be used.
|