Content
Besides being free, Java allows its code to be written once and run on any Operating System that runs Java.This is known as the Platform Independent. This is what sold me on Java!
In my early days of programming, the late 1980s, I wrote programs that ran on the Windows, Unix, AS/400 and a newbie call Linux operating system. Some of my programs was portable and able to recompile to these different environments with some minor changes and tweaking.
Java came out and said no more tweaking, “Write-Once-
Run-Anywhere”. At least it was true on the java application back end. Not so much on the GUI front end at first. But I was able to write my programs once and run on these different operating system. This still stands true today. I should say, in the early days of Java, this tweaking, in the Java arena became to be known has “Write Once, Debug Everywhere”.
I have to say, that’s what made java the most powerful language today. Java was able to deliver this feature more than any other programming languages such as C or C++.
This is important, because most applications today are accessed from the internet. Java language is the most powerful language and is widely used in the web application. Most of the web browser are Java compatible. The most common browsers like: Microsoft Internet Explorer, Google Chrome, Apple Safari, Mozilla Firefox.
Portable means “Platform Independence”, Java can run on diverse operating system and hardware. How? The Java compile the Java code “halfway” to bytecode (specifically Java bytecode), which is a machine instructions specific to the Java platform. The bytecode is an intermediary that is platform neutral. The bytecode runs in the Java virtual machine (JVM).
Each JVM however is specific to the Operating Systems (OS) it runs on. It has standard libraries provided to allow access to features of the host machines (such as graphics, threading and networking) in unified ways. The JVM shields us from the specific compiling of the native machine instructions. The Java bytecode is interpreted or converted to native machine instructions by the Just in Time (JIT) compiler.
One key to Java portability is its data types. The basic data types of the Java language are the same for all OS. The JVM has the standard data size irrespective of operating system or the processor. These features makes the java as a portable language. As part of the feature write-once-run-anywhere, java base data types make it portable.
Java programs run in an area known as the sand box inside the JVM. The Security manager determines a class accesses rights when reading and writing a file. It’s bytecode verifier checks the classes after they are loaded. Public key encryption system to allow the java applications to transmit over the internet in the secure encrypted form.
No more pain and worry in manually managing memory while the Java program runs. We have the Garbage Collector for that.
Languages, like C and C++, the programmer has to allocate memory to create objects stored on the heap and is responsible for later manually deallocating that memory. A lot of programs have crashed because of this hassle with memory leaks and unstable memory operations. Well, again, I say that Java is a well thought out programming language.
It’s all automatic in Java, the Garbage Collector will clean up memory. The programmer determines when objects are created, that’s it. The Java runtime is responsible for managing the object’s lifecycle. When an object is not referenced or used, the Java garbage collector automatically deletes the unreachable object, freeing memory and preventing a memory leak.
Out of the box java has a compiler, interpreter and most importantly its JavaDoc, use to document Java code.
There are more tools like the Java Debugger, Applet Viewer, Header File Generator, etc.