Importing Packages

Java classes are grouped into packages
Import library classes by specifying the package and class name:
import java.awt.Rectangle; //Abstract Windowing Toolkit, for drawing windows & graphical shapes.

You don't need to import classes in the java.lang package such as String and System
 

API: Application Programming Interface

Lists classes and methods in the Java library
http://java.sun.com/javase/7/docs/api/index.html

Take a look of Rectangle class and String class.   How does trim method work?