Wednesday, February 8, 2012

PRIMARY GOALS OF JAVA


Java Technology

The Java technology is:

·        A programming language
·        A development environment
·        An application environment
·        A deployment environment

Programming language
The syntax of the Java programming language is similar to C++ syntax .you can use the Java programming language to create all kinds of applications that you could create by using any conventional programming language. 

Development Environment

As a development environment, Java technology provides you with a large suite of tools: a compiler, an interpreter, a documentation generator, a class file packaging tool, and so on

Application Environment

Java technology applications are standalone programs that do not require a web browser to execute. Typically, they are general-purpose programs that run on any machine where the Java runtime environment (JRE) is installed

Deployment Environment

There are two main deployment environments. First, the JRE supplied by the Java 2 Software Development Kit (Java 2 SDK) contains the complete set of class files for all of the Java technology packages, which includes basic language classes, GUI component classes, an advanced Collections API, and so on. The other main deployment environment is on your web browser. Most commercial browsers supply a Java technology interpreter and runtime environment.   

Primary goals of the Java Technology

Java Technology provides:

A programming language which is easy to implement

  • It eliminates many difficulties of other languages, such as pointer arithmetic and memory management that affect the robustness of the code
  • It is object oriented to visualize program in real life terms.
  • Enables to streamline the code
  • An interpreted environment
  • A for programs to run more than one thread of activity
  • A means to change programs dynamically during their runtime life by enabling them to download code modules
  • A means of ensuring security by checking loaded modules

Benefits of interpreted environment

  • Speed of development –Reduces the compile-link-load-test cycle
  • Code portability-Enables you to write code that can be run on multiple operating systems on any certified JVM   
The Java technology architecture uses the following features:

  • The JVM
  • Garbage collection
  • The JRE
  • JVM toll interface


The JVM
  • A Java virtual machine is software that is implemented on virtual and non-virtual hardware and on standard operating systems. A JVM provides an environment in which Java bytecode can be executed, enabling such features as automated exception handling, which provides "root-cause" debugging information for every software error (exception), independent of the source code.
  •  A JVM is distributed along with a set of standard class libraries that implement the Java application programming interface (API). Appropriate APIs bundled together with JVM form the Java Runtime Environment (JRE).
  • JVMs are available for many hardware and software platforms. The use of the same bytecode for all JVMs on all platforms allows Java to be described as a "write once, run anywhere" programming language, as opposed to "write once, compile anywhere", which describes cross-platform compiled languages. Thus, the JVM is a crucial component of the Java platform.
  • Java bytecode is an intermediate language which is typically compiled from Java, but it can also be compiled from other programming languages. For example, Ada source code can be compiled to Java bytecode and executed on a JVM.
 

Garbage Collection

  • The JVM's heap stores all objects created by an executing Java program. Objects are created by Java's "new" operator, and memory for new objects is allocated on the heap at run time. Garbage collection is the process of automatically freeing objects that are no longer referenced by the program. This frees the programmer from having to keep track of when to free allocated memory, thereby preventing many potential bugs and headaches.
  • The name "garbage collection" implies that objects that are no longer needed by the program are "garbage" and can be thrown away. A more accurate and up-to-date metaphor might be "memory recycling." When an object is no longer referenced by the program, the heap space it occupies must be recycled so that the space is available for subsequent new objects.
  • The garbage collector must somehow determine which objects are no longer referenced by the program and make available the heap space occupied by such unreferenced objects. In the process of freeing unreferenced objects, the garbage collector must run any finalizers of objects being freed.
  • In addition to freeing unreferenced objects, a garbage collector may also combat heap fragmentation. Heap fragmentation occurs through the course of normal program execution.
  • New objects are allocated, and unreferenced objects are freed such that free blocks of heap memory are left in between blocks occupied by live objects. Requests to allocate new objects may have to be filled by extending the size of the heap even though there is enough total unused space in the existing heap.
  • This will happen if there is not enough contiguous free heap space available into which the new object will fit. On a virtual memory system, the extra paging required to service an ever growing heap can degrade the performance of the executing program.


JRE (Java Runtime Environment)                              
  • The Java Runtime Environment (JRE) provides the libraries, the Java Virtual Machine, and other components to run applets and applications written in the Java programming language.
  • In addition, two key deployment technologies are part of the JRE: Java Plug-in, which enables applets to run in popular browsers; and Java Web Start, which deploys standalone applications over a network

No comments:

Post a Comment