Friday, 7 October 2011

Java Features


JAVA  FEATURE

          The inventor of java wanted to design a language which could offer solution to some of the problems encountered in modern programming. Then wanted the language to be not only the language   to be not only reliable Portable and distributed but also simple , compact and interactive . Sun Microsystems officially Java with the following attributes:

1.                            Simple
2.                            Secure
3.                            Portable
4.                            Object-oriented
5.                            Robust
6.                            Multithreaded
7.                            Architecture-neutral
8.                            Interpreted
9.                            High performance
10.                       Distributed
11.                       Dynamic


          Although the above appears to be a list of buzzwords, they appropriately describe the full potential of the language. These features have made Java the first application language of the Word Wide Web. Java will also become the premier language for general purpose stand-alone application.

1.                Simple

       Java was developed by taking the best points from other programming languages, primarily C and C++. Java therefore utilizes algorithms and methodologies that are already proven.
       Error prone tasks such as pointers and memory management have either been eliminated or are handled by the Java environment automatically rather than by the programmer.
       Since Java is primarily a derivative of C++ which most programmers are conversant with, it implies that Java has a familiar feel rendering it easy to use.
2.                Secure

       Java goes to the great security issues by putting in place multilevel system of security.
       First at  the compile time pointers and memory allocation are removed  even though the java compiler produces only correct java code there is still the possibility of the code being tempered with between compilation and runtime. java guards against this by using bytecode Verifier to check the bytecode for language compliance when the code fist enters the interpreter before it gets the chance to run. It also specifies following things that the code does not do any of the following.
Forge pointers
Violate access restrictions
Incorrectly access classes
Overflow or underflow operand stack
Use incorrect parameters of bytecode instructions
Use illegal data conversions
       Second at run time the java interpreter further ensures that classes loaded do not access the file system except in the manner permitted by the client   Or the user.

       Sun Microsystems will soon be adding yet another dimension to the security of java. They are currently working on public key encryption system to allow  java applications to be stored and transmitted over the internet in a secure encrypted form.

3.                Portable

       By porting an interpreter for the java virtual machine to any computer hardware or OS. One is assured that all code compile for it will run on that system this forms the basis for java portability.

4.          Object oriented

       In OOP data is treated as objects to which methods are applied. java’s basic execution unit is the class . the object model in java is simple and easy to extends it also provides reusability of code and dynamic applications.

5.                Robust(strong)

       Java is a robust language. It provides many safeguards to ensure reliable code. The ability to create robust programs was given a high priority in the design of Java. Java is a strictly typed language; it checks the code at compile time. However, it also checks your code at run time. In fact, many hard-to-track-down bugs that often turn up in hard-to-reproduce run-time situations are simply impossible to create in Java.

       There are two reasons for program failure
1. memory management  mistakes
2. mishandled exceptional conditions
       Java manages memory automatically by using garbage collector. Exception conditions are handled in java by  providing object exception handling. In the well written java program all runtime errors can and should be managed by the program.

6.                Multithreaded

Java was designed to meet the real  world requirement of creating                    interactive    networked programs. To accomplishes this java support multithreaded programming which allows  user to write programs that do many things simultaneously.

7.                Architecture neutral
    
Java compiler compiles source code to a stage which is intermediate between source and native machine code. This intermediate stage is known as the bytecode which is neutral. In easy word it can be said that “write once run anywhere,anytime,forever”.

8.                Interpreted

When java code is compiled by the compiler outputs the java bytecode which is an executable for the Java virtual machine(JVM). The bytecode is then run through a java interpreter on any given platform that has the interpreter parted to it. The interpreter converts the code to the target hardware and executes it.

9.           High performance

The Java language supports many high-performance feature such as multithreading, just-in-time compiling, and native code usage.

 Java has employed multithreading to help overcome the performance problems suffered by interpreted code as compared to native code. Since an executing program hardly ever uses CPU cycles 100 % of the time, Java uses the idle time to perform the necessary garbage cleanup and general system maintenance that renders traditional interpreters slow in executing applications. [Note: Multithreading is the ability of an application to execute more than one task (thread) at the same time e.g. a word processor can be carrying out spell check in one document and printing a second document at the same time.

Since the bytecode produced by the Java compiler from the corresponding source code is very close to machine code, it can be interpreted very efficiently on any platform. In cases where even greater performance is necessary than the interpreter can provide, just-in-time compilation can be employed whereby the code is compiled at run-time to native code before execution.
An alternative to just-in-time compilation is to link in native C code. This yields even greater performance but is more burdensome on the programmer and reduces the portability of the code.

10.           Distributed

Java is designed environment of  the internet  because it handles TCP\IP protocol .internet programmers can call on the functions  through the supplied libraries and be able to access files on the internet as easily ,as writing to a local file system.
Java also allow objects on two different computers to execute procedures remotely. java has recently revised this interfaces in a package called Remote Method Invocation(RMI).
This feature brings an unparallel level of abstraction to client server programming.

11.           Dynamic

By connecting to the internet a user immediately has access to thousands of programs and other computers. During the execution of a program java can dynamically load classes that it requires either from the local hard drive from another computer on the local area network or from a computer somewhere on the internet.



Posted By :Ruchita Pandya

1 comment: