Java Reference
In-Depth Information
support in CLDC 1.1, the library was again brought to parity with Java SE, and these
methods returned to the library.
Changes to Multithreading
The core essence of multithreading remains unchanged between the CDLC and the
implementations of Java for larger-footprint devices. However, some key differences exist:
• CLDC 1.0 doesn't support thread naming and the interrupt method; however, you
can find them in CLDC 1.1.
• The suspend , resume , and stop methods, now deprecated in Java SE, are wholly
absent from the CLDC.
• The CLDC doesn't support thread groups and daemon threads.
Changes to java.lang.Runtime
The runtime facility is vastly changed between Java SE and Java ME for both security and
memory reasons. It provides five methods:
getRuntime : This static method returns the global runtime.
exit : Although you can invoke this method, it won't exit the runtime; the entire
application life cycle is managed by the application manager and MIDlets
(see Chapter 3 for more details).
totalMemory : You can use this method to determine the amount of total memory
that's available.
freeMemory : You can use this method to determine the amount of free memory
that's available.
gc : You use this method to invoke a garbage-collection operation.
Changes to java.lang.System
The System class has been heavily modified as well. There's no input stream, because
CLDC devices don't have a traditional console (in fact, there is no way to obtain infor-
mation written to System.out and System.err on most devices, either). The System class
also provides a property accessor called getProperty to obtain information such as the
name of the device host, the character-encoding scheme used by the device, the CLDC
platform version, the MIDP version, and so forth.
 
Search WWH ::




Custom Search