Java

Java is a simple language that can be learned easily, even if you have just
started programming.  A Java programmer need not know the internal of
Java. The syntax of Java is similar to C++. Unlike C++, in which the
programmer handles memory manipulation, Java handles the required
memory manipulations, and thus prevents errors that arise due to improper
memory usage. This unit orients you towards understanding of basic Java
features.  To further enrich your knowledge about the history and basic
features of Java read “Java 2 – Complete Reference”.
Features of Java
Java defines data as objects with methods that support the objects. Java is
purely object-oriented and provides abstraction, encapsulation, inheritance
and polymorphism. Even the most basic program has a class. Any code that
you write in Java is inside a class.
Java is tuned for Web. Java programs can access data across the Web as
easily as they access data from a local system. You can build distributed
applications in Java that use resources from any other networked computer.
Java is both interpreted and compiled. The code is complied to a bytecode
that is binary and platform independent. When the program has to be
executed, the code is fetched into the memory and interpreted on the user’s
machine. As an interpreted language, Java has simple syntax.
When you compile a piece of code, all errors are listed together. You can
execute only when all the errors are rectified. An interpreter, on the other
hand, verifies the code and executes it line by line. Only when the execution
reaches the statement with error, the error is reported. This makes it easy
for a programmer to debug the code. The drawback is that this takes more
time than compilation.
Compilation is the process of converting the code that you type, into a
language that the computer understands - machine language. When you
compile a program using a compiler, the compiler checks for syntactic errors
in code and list all the errors on the screen. You have to rectify the errors
and recompile the program to get the machine language code. The Java
compiler compiles the code to a bytecode that is understood by the Java
environment.
Bytecode is the result of compiling a Java program. You can execute this
code on any platform. In other words, due to the bytecode compilation
process and interpretation by a browser, Java programs can be executed on
a variety of hardware and operating systems. The only requirement is that
the system should have a Java-enabled Internet browser. The Java
interpreter can execute Java code directly on any machine on which a Java
interpreter has been installed.
Thanks to bytecode, a Java program can run on any machine that has a
Java interpreter. The bytecode supports connection to multiple databases.
Java code is  portable.  Therefore, others can use the programs that you
write in Java, even if they have different machines with different operating
systems.
Java forces you to handle unexpected errors. This ensures that Java
programs are robust (reliable), bug free and do not crash.
Due to strong type-checking done by Java on the user’s machine, any
changes to the program are tagged as error and the program will not
execute.  Java is, therefore, secure.
Java is faster than other interpreter-based language like BASIC since it is
compiled and interpreted.