Features of Java
Java Features
The inventors of Java wanted to design a language which could offer solutions to some of the problems encountered in modern programming. They wanted the language to be not only reliable, portable and distributed but also simple, compact and interactive. Sun Microsystems officially describes Java with the following attributes as shown in Table 1.2.
Java 2 Features
|
Additional Features of J2SE 5.0
|
· Complied and Interpreted
|
· Ease of Development
|
· Platform-Independent and Portable
|
· Scalability and Performance
|
· Object-Oriented
|
· Monitoring and Manageability
|
· Robust and Secure
|
· Desktop Client
|
· Distributed
|
· Core XML Support
|
· Familiar, Simple and Small
|
· Supplementary character support
|
· Multithreaded and Interactive
|
· JDBC Row Set
|
· High performance
| |
· Dynamic and Extensible
|
Table 1.2 Features of java
Although the above appears to be a list of buzzwords, they aptly describe the full potential of the language. These features have made Java the first application language of the World Wide Web. Java will also become the premier language for general purpose stand-alone application.
Complied and Interpreted
Usually a computer language is either Complied or Interpreted. Java combines both these approaches thus making Java a two-stage system. First, Java compiler translates source code into what is known as byte code instructions. Byte codes are not machine instructions and therefore, in the second stage, Java interpreter generates machine code that can be directly executed by the machine that is running the Java program. We can thus say that Java is both a complied and an interpreted language.
Platform-Independent and Portable
The most significant contribution of Java over other languages is its portability. Java programs can be easily moved from one computer system to another, anywhere and anytime. Changes and upgrades in operating systems, processors and system resources will not force any changes in Java programs. This is the reason why Java has become a popular language for programming on Internet which interconnects different kinds of systems worldwide. We can download a Java applet from a remote computer onto our local system via Internet and execute it locally. This makes the Internet an extension of the user’s basic system providing practically unlimited number of accessible applets and applications.
Java ensures portability in two ways. First, Java compiler generates bytecode instructions that can be implemented on any machine. Secondly, the size of the primitive data types are machine-independent.
Object-Oriented
Java is a true object-oriented language. Almost everything in Java is an object. All programs code and data reside within objects and classes. Java comes with an extensive set of classes, arranged in packages, that we can use in our programs by inheritance. The object model in Java is simple and easy to extend.
Robust and Secure
Java is a robust language. It provides many safeguards to ensure reliable code. It has strict compile time and run time checking for data types. It is designed as a garbage- collected language relieving the programmers virtually all memory management problems. Java also incorporates the concept of exception handling which captures series errors and eliminates any risk of crashing the system.
Security becomes an important issue for a language that is used for programming in Internet. Threat of viruses and abuse of resources are everywhere. Java systems not only verify all memory access but also ensure that no viruses are communicated with an applet. The absence of pointers in Java ensures that programs cannot gain access to memory locations without proper authorization.
Distributed
Java is designed as a distributed language for creating applications in networks. It has the ability to share both data and programs. Java applications can open and access remote objects on Internet as easily as they can do in a local system. This enables multiple programmers at multiple mote locations o collaborate and work together on a single project.
Simple, Small and Familiar
Java is a small and simple language. Many features of C and C++ that are either redundant or sources of unreliable code are not part of Java. For example, Java does not use pointers, pre-processor header files, goto statement and many others. It also eliminates operator overloading and multiple inheritance.
Multithreaded and Interactive
Multithreaded means handling multiple tasks simultaneously. Java supports multithreaded programs. This means that we need not wait for the application to finish one task before beginning another. For example, we can listen to an audio clip while scrolling a page and at the same time download an applet from a distant computer. This feature greatly improves the interactive performance of graphical applications.
The Java runtime comes with tools that support multiprocess synchronization and construct smoothly running interactive systems.
High Performance
Java performance is impressive for an interpreted language, mainly due to the use of intermediate by bytecode. According to Sun, Java speed is comparable to the native C/C++. Java Architecture is also designed to reduce overhead during runtime. Further, the incorporation of multithreading enhances the overall execution speed of Java programs.
Dynamic and Extensible
Java is dynamic language. Java is capable of dynamically linking in new class libraries, methods and objects. Java can also determine the type of class through a query, making it possible to either dynamically link or abort the program, depending on the response.
Java programs support functions written in other languages such as C and C++. These functions are known as native methods. These facilities enable the programmers to use the efficient functions available in these languages. Native methods link dynamically at runtime.
Ease of Development
Java 2 Standard Edition(J2SE) 5.0 supports features, such as Generics, Enhanced for Loop, Autoboxing or unboxing, Typesafe Enums, Varargs, Static import and Annotation. These features reduce the work of the programmer by shifting the responsibility of creating the reusable code to the compiler. The resulting source code is free from bugs because the errors made by the compiler are less when compared to those made by the programmers. Thus, each of the linguistic features is designed to develop Java programs in an easier way.
Scalability and Performance
J2SE 5.0 assures a significant increase in scalability and performance by improving the startup time and reducing the amount of memory used in Java 2 runtime environment. For example, the introduction of the class, data sharing in the Hotspot Java Virtual Machine (JVM) improves the startup time by loading the core classes from the jar files into s shared archive. Memory utilization is reduced by sharing data in the shared arhive among multiple JVM processes. In the earlier versions, the data was replicated in each JVM instance.
Monitoring and Manageability
Java supports a number of APIs, such as JVM Monitoring and Management API, Sun Management Platform Extension, logging, Monitoring and Management Interface, and Java Management Extension (JMX) to monitor and manage Java applications. For example, Java provides JVM Monitoring and Management API to track the information at the application level and JVM level when deploying a large application. Java provides tools, such as jconsole, jps, jstat and jstatd to make use of monitoring and management facilities. For example, GUI based tool called jconsole is used to monitor the JVM.
Desktop Client
J2SE 5.0 provides enhanced features to meet the requirements and challenges of the Java Desktop users. It provides an improved Swing look and feel called Ocean. This feature is mainly used for developing graphics applications that require OpenGL hardware acceleration.
No comments:
Post a Comment