Subscribe

RSS Feed (xml)

Powered By

Skin Design:
Free Blogger Skins

Powered by Blogger

Monday, November 19, 2007

Importing all classes from a package using *

Java libraries are organized in packages (directories). The most common way to get access to them is to use the import statement. For example,

import java.util.*;
. . .
ArrayList studentNames; // ArrayList is a class in java.util

gives your program access to the all (that's what the "*" means) classes in the package java.util. The source files for these classes are in a directory named util, which is in a directory named java.

No comments:

Post a Comment

Archives