Documents
Resources
Learning Center
Upload
Plans & pricing Sign in
Sign Out

while in Java

VIEWS: 74 PAGES: 3

									2007/S2

KXT101

import statement in Java
Packages group related classes together Java libraries are organised in packages (directories) The import statement allows you to specify package/library classes that can be referenced without qualifying them with their package name For small programs, it is common to omit a package specification (Java creates a default package in this case)

cae@utas

Page 1 of 3

56c3f270-78d4-4721-9db8-fb8a66183a18.doc

2007/S2

KXT101

from Code Conventions for the JavaTM Programming Language:
11.1 Java Source File Example
package java.blah; import java.blah.blahdy.BlahBlah; /** * Class description goes here. * * @version 1.82 18 Mar 1999 * @author Firstname Lastname */ public class Blah extends SomeClass {

cae@utas

Page 2 of 3

56c3f270-78d4-4721-9db8-fb8a66183a18.doc

2007/S2

KXT101

Some Examples:
import java.awt.Color; import java.lang.*; import java.util.*; import java.util.Random; import java.util.Scanner; import pps.*; import pps.PPSFrame; import pps.turtle.*;

cae@utas

Page 3 of 3

56c3f270-78d4-4721-9db8-fb8a66183a18.doc


								
To top