Reducing Class File Sizes

When importing libraries, the fully qualified name—including the class and package name of each imported function—is stored in the class file. Thus, limiting the number of imports may reduce the size of a class file significantly. One large class will probably consume less memory than a set of smaller classes, and the import overhead of additional convenience methods will often weigh more than the code actually saved.

Get Java™ 2 Micro Edition Application Development 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.