Vous êtes sur la page 1sur 7

Java Technology

Java is a widely used programming language


expressly designed for use in
the distributed environment of the internet. It is the
most popular programming language for
Android smartphone applications and is among
the most favored for edge device and internet of
things development.

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.

A brief history of Java

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.

As a result, the Java programming language paid more attention to the


complicated task of network programming than any competing language.
Network programming is always a challenge, but the Java programming
language, through the java.net APIs, took great strides to simplify the
traditionally onerous task of programming across a network.

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.

In October 2009, Google released the Android software developer's kit


(SDK), a standard development kit that made it possible for mobile device
developers to write applications for Android-based devices using Java APIs.

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.

Java 8 was released in March 2014. It includes Lambda expressions, which


are common features in many competing languages but had always been
absent in Java. With Lambda expressions, developers can write applications
using a functional approach, as opposed to an object-oriented one.

The expected 2017 release of JDK 1.9 will be known as Java 9.

Elements and principles of Java

It is difficult to provide a single reason as to why the Java programming


language has become so ubiquitous. However, the language's major
characteristics have all played a part in its success, including the following
components:

 Programs created in Java offer portability in a network. The source


code is compiled into what Java calls bytecode, which can be run
anywhere in a network on a server or client that has a Java virtual
machine (JVM). The JVM interprets the bytecode into code that will run
on computer hardware. In contrast, most programming languages, such
as COBOL, C++, Visual Basic or Smalltalk, compile code into a binary
file. Binary files are platform-specific, so a program written for an Intel-
based Windows machine cannot on run a Mac, a Linux-based machine
or an IBM mainframe. The JVM includes an optional just-in-time (JIT)

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.

 Java is object-oriented. An object can take advantage of being part of


a class of objects and inherit code that is common to the class. Objects
are thought of as "nouns" that a user might relate to rather than the
traditional procedural "verbs." A method can be thought of as one of the
object's capabilities or behaviors. Being object-oriented is relatively
common in today's programming landscape, but back in 1996, only a
handful of languages were implementing object-oriented concepts
and design patterns effectively. The ability to develop with a language
created from the ground up with object-orientation as its explicit purpose
made Java an exciting platform upon which to program.

 Applet offers flexibility. In addition to being executed on the client rather


than the server, a Java applet has other characteristics designed to make
it run fast.

 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:

1. Java SE. Simple, stand-alone applications are developed using Java


Standard Edition. Formerly known as J2SE, Java SE provides all of
the APIs needed to develop traditional desktop 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.

3. Java ME. Java also provides a lightweight platform for mobile


development known as Java Micro Edition, formerly known as J2ME.
Java ME has proved a very popular platform for embedded
device development, but it struggled to gain traction in the smartphone
development arena. In terms of smartphone development, Android has
become the mobile development platform of choice.

Sample Java Program

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.

The JVM performs following main tasks:

o Loads code
o Verifies code
o Executes code
o Provides runtime environment

JVM provides definitions for the:

o Memory area
o Class file format
o Register set
o Garbage-collected heap
o Fatal error reporting etc.

Internal Architecture of JVM

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.

A new frame is created each time a method is invoked. A frame is


destroyed when its method invocation completes.
5) Program Counter Register
PC (program counter) register. It contains the address of the Java virtual
machine instruction currently being executed.
6) Native Method Stack
It contains all the native methods used in the application.
7) Execution Engine
It contains:

1) A virtual processor

2) Interpreter: Read bytecode stream then execute the instructions.

3) Just-In-Time (JIT) compiler: It is used to improve the performance. JIT


compiles parts of the byte code that have similar functionality at the same
time, and hence reduces the amount of time needed for compilation. Here
the term? Compiler? Refers to a translator from the instruction set of a
Java virtual machine (JVM) to the instruction set of a specific CPU.

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:

 Simple logging frameworks for Java (SLF4J).

 Big data processing frameworks, such as Yarn and Hadoop.

 Integration platforms like Apache Camel, Apache Axis and CXF for
RESTful web service development.

 Microservices development platforms.

More enterprises will attempt to transition Java EE environments into


the cloud. As Java developers are creating Java cloud services, the ability to
scale up those services quickly is a key concern, as is the ability to
collaborate in the cloud.

Vous aimerez peut-être aussi