Using Java Libraries

While there are still a number of fundamental basic programming concepts still to be covered, we would also like to be able to start using existing libraries in the Java SDK as quickly as possible. To that aim, this outline will provide "just enough" to illustrate basic core usage of existing Java class libraries.

Builder vs. User

With any re-usable programming construct, we have two points-of-view that should always be considered: Note that for the purposes of this topic (Using Java Libraries), we are looking at things from the user's perspective. In other words, what do we need to know to use an existing Java library from the SDK, along with it's various already-defined features.

We will look at how to build things like functions, classes, interfaces, etc. later on.

What's in the Java SDK?

Right now, we will focus on the usage of class libraries.
 

Using a Java class


The import statement

API descriptions

How to use static fields and methods

Example: the java.lang.Math library

How to use instance fields and methods

Example: the java.util.Random library