Você está na página 1de 10

What Is JAVA?

Java is a high level programming language, general purpose, concurrent


and platform independent. It is a platform providing an API to reuse code
and a runtime environment that avails security, robustness, portability and
automatic garbage collection.

It is used to develop standalone applications, desktop, window, enterprise


and B2B application. Java is developed with an ideal of write once, run
anywhere, anytime and forever.

This exercise is planned to get programming engineers who are new to


java technology up and run with the OOPS and real world applications
using java language and platform.

This first part is a regulated prologue to OOP utilizing the Java dialect.
The exercise starts with a review of the Java stage and language and is
trailed by directions for setting up an improvement environment
comprising of a Java Development Kit (JDK) and the Eclipse IDE. When
you have been acquainted with your improvement surroundings' parts,
you will start learning essential Java grammar active.

History Of Java
In 1991 sun microsystems made efforts to provide an environment or a
new technology that overcomes the complexities in C/C++ and that meet
real time specifications and for programming next generation smart
appliances. These efforts evolved a new programming language oak in
1991.

James gosling was a part of green, an isolated research project at sun that
was studying how to put computers into everyday household items like
thoughtful toasters and lucid lamps. The group also wanted these
communicate with each other.
So, the greens built a prototype device called star7. It was featured as
duke immortalized as kavas mascot.

Sun found that oak could not be trademarked because of a product


already using the name. So it was renamed as java after a meeting
arranged by Kim Polese. Chris Warth suggested the name. James Gosling
was named as father of java for his contribution in the development of
java. The first official release of java including the development tools
was the release of java 1.0 i.e., JDK 1.0 on 23rd Jan, 1996.

Different Flavors of Java:


In this lesson we are going to see the different flavors of Java and
versions.

As in the above diagram there are 3 flavors.


Java Standard Edition (J2SE)
J2SE can be used to develop client-side standalone applications or
applets.
Java Enterprise Edition (J2EE)
J2EE can be used to develop server-side applications such as Java
servlets and Java Server Pages.
Java Micro Edition (J2ME).
Java Versions History:
JDK 1.0 (January 23, 1996)
Codename Oak. Initial release
JDK 1.1 (February 19, 1997)

Major additions included:


An extensive retooling of the AWT event model
Inner classes added to the language
JavaBeans, JDBC, RMI
J2SE 1.2 (December 8, 1998)
Codename Playground. This and subsequent releases through J2SE 5.0
were rebranded retrospectively Java 2 and the version name "J2SE" (Java
2 Platform, Standard Edition) replaced JDK to distinguish the base
platform from J2EE (Java 2 Platform, Enterprise Edition) and J2ME
(Java 2 Platform, Micro Edition
J2SE 1.3 (May 8, 2000)
Codename Kestrel.
J2SE 1.4 (February 6, 2002)
Codename Merlin.
J2SE 5.0 (September 30, 2004)
Codename Tiger. Originally numbered 1.5, which is still used as the
internal version number. This version was developed under JSR 176.
Tiger added a number of significant new language features:
Generics, Metadata, Auto boxing/un boxing, Enumerations, Varargs, for
each loop and etc.
Java SE 6 (December 11, 2006)
Codename Mustang. As of this version, Sun replaced the name "J2SE"
with Java SE and dropped the ".0" from the version number. Internal
numbering for developers remains 1.6.0. This version was developed
under JSR 270.

Java SE 7
Java 7 (codename Dolphin) is an upcoming major update to Java.. The
Dolphin Project began in August 2006 and is tentatively scheduled for
release in late 2010.
JDK Versions:
JDK 1.02 (1995)
JDK 1.1 (1996)
JDK 1.2 (1998)
JDK 1.3 (2000)
JDK 1.4 (2002)
JDK 1.5 (2004) or JDK 5 or Java 5
JDK 1.6 (2006) or . JDK 6 or Java 6, JDK 1.7 also released.

Features Of Java

1. Simplicity: It is designed to be easy to learn and use. Java supports the


concept of oops and restricts complexities like the concept of
pointers responsible of errors in programming. It provides small no
of clear tasks to achieve a given task.
2. Object Oriented: Everything in java is an object resembling real life.
Java is an object oriented programming language supporting the
important

aspects

of

OOPs:

Encapsulation, data

hiding,

polymorphism, and inheritance.


3. Portability: java has specific size for its data in the program, which is
independent of OS or the architecture that enables java to be a
portable language. Java makes it possible to have the assurance
that any result on one computer with java can be replicated on
another.
4. Platform Independent (Architecture Neutral): The intermediate
language code developed during compilation of the java source
code is independent of the architecture of OS of computer and is
interpreted as the native code of the system.
5. Robustness:

Most programs in use today fail for one of the two

reasons:
i) Memory management mistakes: for example in C/C++, the
programmer must manually allocate and free all dynamic memory.
This sometimes leads to problems because programmers will either
forget to free memory or try to free some memory that another part
of code is already using. Java virtually eliminates these problems
by managing memory allocation (with the help of new operator)
and de-allocation (it is completely automatic because java has

garbage collection for unused objects).


ii) Mishandled exception conditions: With the help of exception
handling, (try..catch block), the programmer can easily handle
an error or exception so user can prevent the program by
automatically stop he execution when an exception is found.
6.

Secure: Java achieves this protection by confining a java program


to the java execution environment and by making it inaccessible to
other parts of the computer.

7.

Interpreted and high performance: Java uses an interpreter or


JIT compiler to execute the java byte code from its source into the
machine code, which is highly, optimized set of instruction code.
The compiled java byte code can be interpreted on any system,
which has a JVM and generates machine code. The runtime
performance is slow when an interpreter translates byte code into
processor understandable code and execute in machine code. To
enhance the runtime performance JIT compilers are used. This
translates java byte code to the native machine code directly during
the run time.

8.

Strong Memory Management: Automatic memory allocation and


automatic garbage collection in Java improve the strong capability
of java in maintaining memory.

9.

Multithreaded nature: Multithreading of a program is a process


of independent execution of different threads simultaneously
without any interruption with one another. This makes the design
of java to meet the real life requirements and to interact on the
internet and create networking applications.

10.

Built-in Networking and Distributed Programming: This


feature enables java as Internet oriented language or networking
language. Java is widely used in the area of creating web

applications on the Internet.


11.

Dynamic: Java programs have the ability to access the required


information of the objects during the runtime which enables it to be
dynamic programming language.

JVM Architecture
JVM is one of the most important components of java platform and java
architecture. It is an abstract computer that provides software to execute
programs. JVM is loaded into the memory of a computer (CPU) to run a
program. Java programs always run on any computer provided with the
JVM. Each application can be used in different system platforms at a
time.

When the dot class files are loaded on JVM, JVM refers to the Java API,
which includes the source code for .class files. JIT compiler and
interpreter of JVM execute the java byte code of .class files into native
machine code. JVM and Java Library together constitute the Java
Runtime environment.
Architecture (figure)
Internal Architecture of JVM:
The behavior of JVM at runtime is explained by the internal architecture
of JVM as shown in the block diagram.
Class Loader System: A subsystem of JVM that loads the classes and
interfaces of the class files into the memory.
Runtime Data Areas: It is the memory location on area required by JVM
to store the information of classes from the class loader subsystem to run
a program.
The run time data areas such as method area, heap, java stacks, pc
registers and native method stacks are employed to store the byte code
information such as method parameters, return types, its values and
variables from the class files that have been loaded in the class loader

subsystem.
Method Area: It is used to store the class data. the description of class
files, code of the methods, the constructors and the constant pool.
Heap: It is the memory area for the creation and removal of objects i.e.,
dynamic memory allocation and garbage collection.
Java Stacks: These are formerly known as virtual machine stacks and
defined, as the memory areas require invoking methods and executing
them in LIFO manner.
PC Registers: program counters of JVM store the memory address of the
next executable byte code instructions. These are modified update the
memory location for the CPU. So that the memory becomes free for the
next byte code instruction to be executed after every byte code
instructions execution.
Native Method Stacks: It stores native methods at runtime. ams are
linked with native processor with an interface program defined as the
native method interface. This interface includes the native method
libraries, which provide the source code for the invoked native methods
during the process of execution.
Execution Engine: It includes an interpreter and JIT compiler, which are
used simultaneously to enhance the execution. The executing engine
transforms the java byte code instructions into the native machine code,
thus completing the process of executing a java application.

Você também pode gostar