Escolar Documentos
Profissional Documentos
Cultura Documentos
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.
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
aspects
of
OOPs:
Encapsulation, data
hiding,
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
7.
8.
9.
10.
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.