The CLDC Class Libraries

CLDC addresses a wide range of platforms that do not have sufficient memory resources to support the full range of packages and classes provided by J2SE. Because CLDC is a configuration rather than a profile, it cannot have any optional features. Therefore, the packages and classes that it specifies must have a small enough footprint that they can be hosted by devices that meet only the minimum requirements of the CLDC specification. The CLDC class library is very small -- it is composed of a package containing functionality that is specific to J2ME (called javax.microedition.io), along with a selection of classes from the following packages in the core J2SE platform:[5]

  • java.io

  • java.lang

  • java.util

All J2ME configurations and profiles include packages or classes from J2SE. When J2ME incorporates software interfaces from J2SE, it must follow several rules:

  • The names of the packages or classes must be the same, wherever possible. It would not be acceptable, for example, to completely reimplement the java.lang package in a package called javax.microedition.lang if the API in the java.lang package can be used.

  • The semantics of classes and methods that are carried over into J2ME must be identical to those with the same name in J2SE.

  • It is not possible to add public or protected fields or methods to a class that is shared between J2SE and J2ME.

Because of these rules, J2ME packages and classes will always be a subset of the packages and classes of the same ...

Get J2ME in a Nutshell now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.