Ads 468x60px

Monday, July 25, 2011

Java's Features


Java's Features

Sun describes Java as a "simple, object-oriented, interpreted, robust, secure, architecture-neutral, portable, high-performance, multithreaded, and dynamic language."
Each of the features mentioned in this quotation from Sun's Web page is an important part of the Java development environment as well as a critical requirement for Web programming. The combination of these features makes Java a powerful and useful programming language that empowers you, the programmer, with the tools you need to easily create powerful programs for today's distributed environments.

Simple

Java is simple to use for three main reasons: First, Java is familiar to you if you know C. Second, Java eliminates components of C that cause bugs and memory leaks and replaces their functionality with more efficient solutions and automated tasks, so you have a lot less debugging to worry about than you would using C or C++. Third, Java provides a powerful set of pre-tested class libraries that give you the ability to use their advanced features with just a few additional lines of code.

Object-Oriented

Java is an object-oriented programming language that uses software objects called classes and is based upon reusable, extensible code. This means that you can use Java's classes, which are sets of variables and methods, as templates to create other classes with added functionality without rewriting the code from the parent classes or superclasses. If you plan your application's class hierarchy well, your application will be small and easy to develop. The hierarchy of classes is explained later in this chapter.

Robust

Java is robust because the language removes the use of pointers and the Java runtime system manages memory for you. The problems with pointers in C and C++ was that pointers directly addressed memory space. In a distributed environment like the Internet, when code is downloaded to diverse systems, there is no way of knowing for sure that memory space addressed by pointers is not occupied by the system. Overwriting this memory space could crash a system. Java also gives you automatic bounds checking for arrays, so they cannot index address space not allocated to the array. Automatic memory management is done using the Garbage Collector, which is explained in detail in Chapter 4, "Creating Your Own Objects."

Interpreted

Java is interpreted, so your development cycle is much faster. As you learn later when the Java interpreter is discussed, you need only to compile for a single, virtual machine and your code can run on any hardware platform that has the Java interpreter ported to it.

Secure

Java is secure, so you can download Java programs from anywhere with confidence that they will not damage your system. Java provides extensive compile-time checking, followed by a second, multilayered level of runtime checking. Java's security structure is described in detail in Chapter 19, "Security Issues."

Architecture Neutral

Java is architecture neutral, so your applications are portable across multiple platforms. Java's applications are written and compiled into byte code for Java's virtual machine, which emulates an actual hardware chip. Byte code is converted to binary machine code by the Java interpreter installed at the client, so applications need not be written for individual platforms and then ported from platform to platform. Java additionally ensures that your applications are the same on every platform by strictly defining the sizes of its basic data types and the behavior of its arithmetic operators. Operator overloading, the process of modifying the behavior of operators, is prohibited by Java.

High Performance

Java is "high performance" because its byte code is efficient and has multithreading built in for applications that need to perform multiple concurrent activities. Although threads still require the use of classes, Java balances the addition of thread synchronization between the language and class levels. Java's byte code is efficient because it is compiled to an intermediate level that is near enough to native machine code that performance is not significantly sacrificed when the Java byte code is run by the interpreter.

Dynamic

Java is dynamic, so your applications are adaptable to changing environments because Java's architecture allows you to dynamically load classes at run time from anywhere on the network, which means that you can add functionality to existing applications by simply linking in new classes. For example, if your applet is being run by a browser that doesn't have one of the classes included in your applet's byte code, the browser can download the appropriate class from the server that is storing your applet, check the byte code, and execute it. This is assuming your browser has not been configured with strict security

1 comments:

  1. More Important Features of Java development - Multithreading, AWT and Event Handling, Networking, Socket and Database Connection.

    ReplyDelete