Learning
Objectives
After completing this session, you will be able to:
Explain the
history of Java
Describe the
features or characteristics of Java
Explain applets
Describe Java
Virtual Machine (JVM) and bytecode
Explain Java
Runtime Environment (JRE) and Java Development Kit (JDK)
History
of Java
The original name of Java was Oak, and it was developed
as a part of the Green project at Sun Microsystems.
Java was conceived by James Gosling, Patrick Naughton,
Chris Warth, Ed Frank, and Mike Sheridon at Sun Microsystems in 1991.
The ultimate objectives of the team were:
To ensure
security
To ensure
reliability
To set up a
platform independent language completely that would function seamlessly,regardless of the CPU
The World Wide Web (WWW), by nature, had requirements
such as reliability, security, and architecture independence, which were fully compatible
with the design patterns of Java.
Sun formally announced the Java SunWorld in 1995.
Java
Technology
Java is a
programming language.
Java is a
development environment that provides tools such as compiler, interpreter,documentation generator, and so on.
Java is an
application environment to run standalone programs that run on any machine where the Java Runtime Environment (JRE) is
installed.
Java is a
deployment environment that supplies Java2 Software Development Kit(J2SDK) with complete set of Application Programming
Interface (APIs) as packages.
Java provides an
easy-to-use language by avoiding pitfalls of other languages, such as pointer arithmetic and memory management, which affect
the robustness of the code.
Features or Characteristics of Java
The features of Java are:
Simple
Object oriented
Secure
Platform
independent
Robust
Portable
Automatic
garbage collection
Dynamic
Multithreaded
Distributed
Applets
An applet is a
program written in the Java programming language that can be included in a HTML page, much in the same way an image is included
in a page.
An applet is
designed to be transmitted overthe Internet and is executed by a Java compatible Web browser.
An applet can
react to user input dynamically.
Because applets
are executed in the client machine, Java enforces a lot of restriction on applets.
Overview of Java Virtual Machine
Java Virtual
Machine (JVM) specification defines the JVM as an imaginary (virtual) machine that is implemented by emulating itin software on
a real machine. Code for the JVM is stored in .class files, each of which contains
code for at most one public class.
The
specification enables the Java language to be platform independent.
JVM is
implemented in a Java technology development tool or in a Web browser.
Bytecode:
Bytecode is a highly optimized set of instructions designed to be executed by the JVM.
The key that
allows Java to solve both the security and the portability problem is the output of Java compiler, which is not an executable code
rather it is the bytecode.
The JVM is
ported to different platforms toprovide hardware and operating system independence, which is environment independent of
hardware and operating system.
JVM needs to be
implemented for each platform.
Java SE or J2SE Runtime Environment
J2SE stands for
Java 2 Standard Edition. From Java SDK API version 1.5 onwards, this is referred to as Java SE (Java Standard Edition).
The JRE provides
the libraries, JVM, Java Interpreter, and other components
necessarily for you to run applets and applications
written in Java.
JRE is
responsible for loading, verifying, and executing the bytecodes.
The JDK includes
the JRE as well as command-line development tools, such as compilers and debuggers that are necessary or useful for
developing applets andapplications.
The Java API is
a code that is written earlier, organized into packages of similar topics, and it is a part of JDK libraries.
Tips and Tricks
What is a Java program? What do you actually deliver?
Solution:A Java program is a pile of classes (or at least
one class). In a Java application, one of the classes must have a main method, used to start-up the
program. So as a programmer, you write one or more classes, which you deliver. If the
end-user does not have a JVM, then you will
also need to include that with the classes of
yourapplication, so that they can run your program.
There are a number of installer programs that lets you to
bundle your classes with a variety of JVMs (say, for different platforms), and put it all on a
CD-ROM. Then the end-user can install the correct version of JVM (assuming they donot already have
it on their machine.).
Summary
Keeping the
following objectives in mind, Java language has been developed:
Security
Reliability
Completely
platform independent and functions seamlessly regardless of the type of CPU
Java is a
development environment, which provides tools like compiler, interpreter,
No comments:
Post a Comment