Game Development Reference
In-Depth Information
Java
Java is an object-oriented, multi-purpose programming language based on classes.
It's main feature is portability and its motto is "write once, run anywhere!". Java is de-
signed to be as platform-independent as possible, so that Java programs will run re-
gardless of the platform. This is achieved thanks to the Java Virtual Machine ( JVM ),
a program which compiles programs written in Java into bytecode. Bytecode is ana-
logous to low-level machine code, so that programs can run with different operating
systems or hardware configurations.
Java derives most of its syntax from C and C++, though it is considered to be far easi-
er on its users!
Unfortunately, portability has its price; as with any interpreted program, Java code
tends to be slower and requires more memory than software written with compiled
languages such as C++. Anyway, since Just-In-Time compilation was added in 1998,
the execution speed of programs written with Java has improved.
The Java SE platform, which is derived from the original implementation by former
developer and owner, Sun Microsystems, is the current implementation of the Java
platform and it is available for Mac OS X, Windows, and Solaris. The Oracle imple-
mentation is distributed into two versions: Java Runtime Environment ( JRE ), which
is required to run Java programs and Java Development Kit ( JDK ), intended to de-
velop software and contains the usual development tools (compiler, debugger, and so
on).
Several platforms offer direct hardware support to Java code; not only computers, Mi-
crocontrollers, TVs, but even video-recorders are controlled through Java code!
More important for the scope of this topic, ARM-based processors can implement
hardware support for Java bytecode, and 95 percent of today's smartphones host an
ARM processor.
Memory management
Besides portability, the other main feature of Java is its automatic garbage collector.
Java doesn't allow explicit memory management. Once the programmer creates an
object, the garbage collector takes care of freeing the memory allocated to it, if no
Search WWH ::




Custom Search