Introduction of Java

WHAT IS JAVA?

The term Java refers to more than just a computer language like C or Pascal. Java encompasses
several distinct components:-

        A high-level language – Java is an object-oriented language whose source code at a glance looks  very similar to C and C++ but is unique in many ways.
        Java bytecode – A compiler transforms the Java language source code to files of binary
instructions and data called bytecode that run in the Java Virtual Machine.
       Java Virtual Machine (JVM) – A JVM program takes bytecode as input and interprets the instructions just as if it were a physical processor executing machine code. Sun Microsystems owns the Java trademark (see the next section on the history of Java) and provides a set of programming tools and class libraries in bundles called Java Software Development Kits (SDKs). The tools include javac, which compiles Java source code into bytecode, and java, the executable program that creates a JVM that executes the bytecode. Sun provides SDKs for Windows, Linux, and Solaris. Other vendors provide SDKs for their own platforms (IBM AIX and Apple Mac OS X, for example). Sun also provides a runtime bundle with just the JVM and a few tools for users who want to run Java programs on their machines but have no intention of creating Java programs. This runtime bundle is called the Java Runtime Environment (JRE).

 

CREATION OF JAVA (History of java)

     Java was conceived by James Gosling, Patrick Naughton, Chris Warth, Ed Frank, and
Mike Sheridan at Sun Microsystems, Inc. in 1991. It took 18 months to develop the first
working version.
         This language was initially called "Oak" but was renamed "Java" in
1995. Between the initial implementation of Oak in the fall of 1992 and the public
announcement of Java in the spring of 1995, many more people contributed to the design
and evolution of the language. Bill Joy, Arthur van Hoff, Jonathan Payne, Frank Yellin,
and Tim Lindholm were key contributors to the maturing of the original prototype.
   platform independence, since it must run on devices from multiple manufacturers extreme
reliability (can’t expect consumers to reboot their VCRs!) compactness, since embedded
processors typically have limited memory.
   They also wanted a next-generation language that built on the strengths and avoided the weaknesses of earlier languages. Such features would help the new language provide more rapid software development and faster debugging.

     By 1993 the interactiveTVand PDAmarkets had failed to take off, but internet and web activity  began its upward zoom. So Sun shifted the target market to internet applications and changed the name of the project to Java. The portability of Java made it ideal for the Web, and in 1995 Sun’s HotJava browser appeared. Written in Java in only a few months, it illustrated the power of applets – programs that run within a browser – and the ability of Java to accelerate program development. Riding atop the tidal wave of interest and publicity in the Internet, Java quickly gained widespread recognition (some would say hype), and expectations grew for it to become the dominant software for browsers and perhaps even for desktop programs. However, the early versions of Java did not possess the breadth and depth of capabilities needed for desktop applications. For example, the graphics in Java 1.0 appeared crude and clumsy compared with the graphics features available in software written in C and other languages and targeted at a single operating system.

 

Versions of Java

         Since its introduction, Sun has released new versions of the Java core language with significant
enhancements about every two years or so. Until recently, Sun denoted the versions with a 1.x
number, where x reached up to 4. (Less drastic releases with bug fixes were indicated with a third
number as in 1.4.2.) The next version, however, will be called Java 5.0. Furthermore, Sun has
split its development kits into so-called editions, each aimed towards a platform with different
capabilities. Here we try to clarify all of this.

  Standard Edition

    Below is a time line for the different versions of the Standard Edition (SE) of Java, which offers
the core language libraries (called packages in Java) and is aimed at desktop platforms.We
include a sampling of the new features that came with each release.

1995 – Version 1.0. The Java Development Kit (JDK) included:
8 packages with 212 classes.
Netscape 2.0–4.0 included Java 1.0.
Microsoft and other companies licensed Java.

1997 – Version 1.1
23 packages, 504 classes.
Improvements included better event handling, inner classes, improved VM. Microsoft developed
its own 1.1-compatible Java Virtual Machine for the Internet Explorer.
Many browsers in use are still compatible only with 1.1. Swing packages with greatly improved
graphics became available during this time but were not included with the core language.

1999 – Version 1.2. Sun began referring to the 1.2 and above versions as the Java 2 Platform.
The Software Development Kit (SDK) included: 59 packages, 1520 classes.
Java Foundation Classes (JFC), based on Swing, for improved graphics and user interfaces, now
included with the core language. Collections Framework API included support for various lists,
sets, and hash maps.

2000 – Version 1.3:
76 packages, 1842 classes.
Performance enhancements including the Hotspot virtual machine.

2002 – Version 1.4:
135 packages, 2991 classes.
Improved IO, XML support, etc.

2004 – Version 5.0 (previously known as 1.5). This version was available only in beta release as
this book went to press. See Section 1.9 for an overview of what is one of the most extensive
updates of Java since version 1.0. It includes a number of tools and additions to the language to
enhance program development, such as:
      faster startup and smaller memory footprint
      metadata
      formatted output
      generics
      improved multithreading features
      165 packages, over 3000 classes

 

Other editions

       Embedded processor systems, such as cell phones and PDAs, typically offer very limited
resources as compared to desktop PCs. This means small amounts of RAM and very little disk
space or non-volatile memory. It also usually means small, low-resolution displays, if any at all.
So Sun offers slimmed-down versions of Java for such applications. Until recently this involved
three separate bundles of Java 1.1-based packages, organized according to the size of the
platform. Java Card is intended for extremely limited Java for systems with only 16 KB nonvolatile
memory and 512 bytes volatile. The Embedded Java and Personal Java bundles are
intended for systems with memory resources in the 512 KB and 2 MB ranges, respectively. To
provide a more unified structure to programming for small platforms, Sun has replaced Embedded
Java and Personal Java (but not JavaCard) with the Java 2 Micro Edition (J2ME). The developer
chooses from different subsets of the packages to suit the capacity of a given system. At the other
extreme are high-end platforms, often involving multiple processors, that carry out large-scale
computing tasks such as online stores, interactions with massive databases, etc. With the Java 2
Platform came a separate set of libraries called the Java 2 Enterprise Edition (J2EE) with
enhanced resources targeted at these types of applications. Built around the same core as Standard
Edition packages, it provides an additional array of tools for building these so called middleware
products.




  JAVA FEATURES AND BENEFITS

   Before we examine how Java can benefit technical applications, we look at the features that make Java a powerful and popular general programming language.
These features include:

Compiler/interpreter combination
• Code is compiled to bytecode, which is interpreted by a Java Virtual Machine (JVM). This
provides portability to any base operating system platform for which a virtual machine has been
written.
· The two-step procedure of compilation and interpretation allows for extensive code checking and improved security.

Object-oriented
• Object-oriented programming (OOP) throughout – no coding outside of class definitions.
• The bytecode retains an object structure.
• An extensive class library available in the core language packages.

Automatic memory management
• A garbage collector in the JVM takes care of allocating and reclaiming memory.

Several drawbacks of C and C++ eliminated
• No accessible memory pointers.
• No preprocessor.
• Array limits automatically checked.

Robust
• Exception handling built-in, strong type checking (that is, all variables must be assigned an
explicit data type), local variables must be initialized.

Platform independence
• The bytecode runs on any platform with a compatible JVM.
• The “Write Once Run Anywhere” ideal has not been achieved (tuning for different
platforms usually required), but is closer than with other languages.

Security
• The elimination of direct memory pointers and automatic array limit checking prevents
rogue programs from reaching into sections of memory where they shouldn’t.
• Untrusted programs are restricted to run inside the virtual machine sandbox. Access to
the platform can be strictly controlled by a Security Manager.
• Code is checked for pathologies by a class loader and a bytecode verifier.
• Core language includes many security related tools, classes.

Dynamic binding
• Classes, methods, and variables are linked at runtime.


TECNOLOGY USED IN JAVA

1. Console based,
2. Window based,
3. Web-application based-   These are divided into two types-
            1. Web pages (Static web pages)
            2. Web application (Dynamic&Ststic web pages)

No comments:

Post a Comment