Introduction to Java and its Brief History:
Java is a general purpose, class based, and robust, secure, safe, object-oriented
programming language.
It was developed by sun micro system in 1991 by James Gosling its name was
Oak. In 1995, its name has been changed to Java because of some legalissues.
Java was designed for development of software for consumer electronic devices
like TVs, VCRs, toaster etc.
Java removes limitation like portability and reliability of C and C++.
Java program would run in fundamentally different execution environments.
Java is strongly typed language.
Compile time contains translating programs into a machine independent byte
code representation.
Runtime activities include loading and linking of classes needed to execute a
program, optional machine code generation, dynamic optimization of program.
Most striking feature of java is platform independence. Java is not tied to any
particular hardware or OS. Java programs can be executed anywhere on any
system.
Features of Java:
The Java programming language is a high-level language with the following
features:
Simple: Java is simple language and it is easy to write and read. The
syntax of Java is derived from C/C++, that's why it is simple.
Object-Oriented: Java is pure object-oriented programming, every
entity in Java is an object. All Java programs reside inside objects and
classes. So, no coding outside of class definitions, including main()
method.
, Distributed: Java has networking facilities, so, it allows the object to
access information across the network between multiple machines. With
this feature, we can develop network communication facilities.
Platform Independent: Platform independent refers to independent of
any OS, java compiler generates a platform independent code, called byte
code. The byte code can be interpreted in any system which has JVM
installed. This is why, Java is a portable language.
Architectural neutral: Architectural neutral refers to hardware
independent or format of this system-independent binary code. If the Java
runtime environment (JRE) system is installed on a given system, an
application written in Java can then execute on that platform without any
changes requirement.
Multithreaded: Multithreading means handling more than one job at a
time, threads are light weight processes.
Dynamic: Java is a dynamic language, it is capable of linking dynamic
new classes, methods and objects during runtime.
Portable: The byte code generated by Java compiler can be used on any
machine. So, Java is portable.
Robust: Robust means strong, where it checks the reliability of the code
before execution. Java language gives importance to memory
management by using the technique called Garbage Collection and
Exception Handling.
Secure: Java is secure because it does not use memory pointers
explicitly, and its byte code is not readable by human. Also, it contains
Garbage Collector, Exception Handling, Byte code Verifier and Security
Manager. Java uses the encryption systems for applications to secure
them on Internet.
Interpreted: In general, computer languages are either compiled or
interpreted. But Java combines both compiler and interpreter. Java
programs are first compiled into byte code. This byte code is interpreted
by JVM.