Académique Documents
Professionnel Documents
Culture Documents
Java was designed to have the look and feel of the C++ language, but it is
simpler to use than C++ and enforces an object-oriented
programming model. Java can be used to create complete applications that
may run on a single computer or be distributed among servers and clients in
a network. It can also be used to build a small application module
or applet for use as part of a webpage.
In 1996, the internet and the World Wide Web were just starting to emerge.
At that time, Microsoft's flagship Windows 95 operating system wasn't even
packaged with an internet browser. Java wasn't actually designed with the
internet in mind. Instead, Sun Microsystems engineers like James Gosling
envisioned a world of small, appliance-sized, interconnected devices that
could communicate with each other.
The first full increment of Java occurred on Jan. 23, 1996, and was originally
called Oak before being renamed due to trademark concerns. The well-
known JavaBeans interface was introduced in Java 1.1 in February 1997.
1
Over the years, versions of Java releases have received colloquial
nicknames, such as JDK 1.2 being referred to as Java 2.
Java 2 saw large improvements to API collections, while Java 5 included big
changes to Java syntax through a new feature called Generics.
Oracle Corp. took over the Java platform when it acquired Sun Microsystems
in January 2010. The acquisition delayed the release of Java 7, and Oracle
scaled back some of the more ambitious plans for it.
2
compiler that dynamically compiles bytecode into executable code as an
alternative to interpreting one bytecode instruction at a time. In many
cases, the dynamic JIT compilation is faster than the virtual machine
interpretation.
The code is robust. Unlike programs written in C++ and some other
languages, Java objects contain no references to data external to
themselves or other known objects. This ensures that an instruction
cannot contain the address of data storage in another application or in
the operating system itself, either of which would cause the program and
perhaps the operating system itself to terminate or crash. The JVM makes
a number of checks on each object to ensure integrity.
Developers can learn Java quickly. With syntax similar to C++, Java is
relatively easy to learn, especially for those with a background in C.
3
Java platforms
There are three key platforms upon which programmers develop Java
applications:
2. Java EE. The Java Enterprise Edition, formerly known as J2EE, provides
the ability to create server-side components that can respond to a web-
based request-response cycle. This arrangement allows the creation of
Java programs that can interact with internet-based clients, including web
browsers, CORBA-based clients and even REST- and SOAP-based web
services.
class Simple{
public static void main(String args[]){
System.out.println("Hello Java");
}
}
4
JVM (Java Virtual Machine)
JVM (Java Virtual Machine) is an abstract machine. It is a specification that
provides runtime environment in which java bytecode can be executed.
JVMs are available for many hardware and software platforms. JVM, JRE
and JDK are platform dependent because configuration of each OS differs.
But, Java is platform independent.
o Loads code
o Verifies code
o Executes code
o Provides runtime environment
o Memory area
o Class file format
o Register set
o Garbage-collected heap
o Fatal error reporting etc.
5
Let's understand the internal architecture of JVM. It contains classloader,
memory area, execution engine etc.
1) Classloader
Classloader is a subsystem of JVM that is used to load class files.
2) Class (Method) Area
Class (Method) Area stores per-class structures such as the runtime
constant pool, field and method data, the code for methods.
3) Heap
It is the runtime data area in which objects are allocated.
4) Stack
Java Stack stores frames. It holds local variables and partial results, and
plays a part in method invocation and return.
Each thread has a private JVM stack, created at the same time as thread.
1) A virtual processor
6
Examples of Java in use
Using the various components provided by Java EE, it is easy for developers
to write programs that employ popular software design patterns and
universally agreed upon best practices.
For example, Struts, Spring and JavaServer Faces frameworks all use a
Java servlet to implement the front controller design pattern for centralizing
requests.
Meanwhile, a big part of the Java ecosystem is the large variety of open
source projects, software platforms and APIs that the community has built
using the language. For example, the Apache Foundation hosts a variety of
projects written using Java, including:
Integration platforms like Apache Camel, Apache Axis and CXF for
RESTful web service development.