The inventors of Java wanted to design a language that could offer solutions to some of the problems encountered in modem programming here describe all java features in detail.

They wanted the language to be not only portable, reliable, and distributed but also simple, interactive, and compact.

java features

Java 2 Features

Compiled and Interpreted

Usually, a computer language is either compiled or interpreted Java combines both these approaches thus making Java a two-stage system

First, the Java compiler translates source code into what is known as bytecode instructions. Bytecodes ( .class file ) are not machine instructions and then the 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 compiled and an interpreted language.

Platform-Independent and Portable

The most significant contribution of Java is its portability, Java programs can be easily moved from one computer system to another system you want, anywhere and anytime.

Changes or upgrades in OS, 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 the Internet which interconnects different kinds of systems worldwide.

We can download a Java applet from an anyone computer onto our system via the Internet and execute it.

Java ensures portability in two ways. First, the Java compiler generates bytecode instructions (create .class file) that can be implemented on any machine. Secondly, primitive data types size are machine independent

Object-Oriented

Java is a pure object-oriented language. Almost everything in Java is an object. Mostly program 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 or interfaces. The object model in Java is simple and easy to extend and implements.

Robust and Secure

Java is a robust language java provides safeguards to ensure reliable code. It has a strict compile

time and run-time checking for data types.

the programmers virtually all memory management problems. Java also incorporates the concept of exception handling which captures serious errors and eliminates any risk of crashing the system.

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 access memory locations.

Distributed

Java is designed as a distributed language for creating applications. It has the ability to share both data and programs.

Java applications can access remote objects on the Internet as easily as they can in a local system.

This enables multiple programmers at multiple remote locations to collaborate and work together on a single project.

Simple, Small, and Familiar

Preprocessor, goto statements, header files, and many others. It also eliminates multiple inheritances and operator overloading. For a more detailed comparison of Java with C and C++,

familiarity is another striking feature of Java. To make the language look familiar to the existing programmers, it was modeled on C and C++ languages.

Java uses many constructs of C and C++ and therefore, Java code “looks like a C++ code. In fact, Java is a simplified version of C++

Multithreaded and Interactive

Multithreaded means handling multiple tasks simultaneously. Java also supports multithreaded programs.

So that we need not wait for the application to finish one task before continuing another task.

The Java runtime comes with tools that support multiprocess synchronization and smoothly running interactive systems.

High-Performance

Java performance is impressive for an interpreted language, java use of intermediate bytecode.

According to Sun, Java speed is comparable to the native C/C++, and Java architecture is also designed to reduce overheads during runtime.

the incorporation of multi-reading enhances the overall execution speed of Java programs.

Dynamic and Extensible.

Java is a dynamic language. Java is capable of dynamically linking in new class libraries, objects, and methods.

programs support functions written in other languages such as C and C++. this function is known as the native method. this Native method is linked dynamically at runtime.

Additional Features of J2SE 5.0

Ease of Development

Java 2 Standard Edition (J2SE) 5.0 supports features, such as Generics, and Enhanced for Loop. Autoboxing or unboxing. Varargs, Static import, Typesafe Enums, and Annotation.

These features reduce the work of the programmer by creating reusable code for the compiler.

The source code is free from bugs because the errors made by the compiler are less than compared to made by 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 the 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 a shared archive.

Memory utilization is reduced by sharing data. 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, Logging, Monitoring and Management Interface, Sun Management Platform Extension, 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 console, jps, jstat, and statd to make use of monitoring and management facilities. For example, GUI-based tool called a console is used to monitor the JVM.

Desktop Client

the Java desktop users. It provides an improved Swing look and feels called Ocean. This feature is mainly used for developing graphics applications that require OpenGL hardware acceleration.

JDBC RowSet

Java supports JDBC RowSet to send data in a table format between the remote components of a distributed enterprise application.

JDBC RowSet contains CachedRowSet and WebRowSel objects. The CachedRowSet object is a JavaBean that acts like a container.

This object contains a number of rows of data, which are retrieved from the database. The data stored in the CachedRowSet can be directly accessed without connecting to the database or any other data source.

The rows of data that are retrieved from the database can be synchronized later. The WebRowSet object can operate without being connected to the database. The WebRowSet object uses XML format to write and read the rowset

Enhancements in Java SE 6

Some of the key enhancements in Java SE 6 are:

  • Scripting Language Support: Java SE 6 integrates various scripting languages such as Java Script and PHP Script into the Java platform. It allows scripts to be embedded in Java programs and compiled and executed with the help of the appropriate scripting engine.
  • XML Processing and Web Services: It allows the development of Web services and clients that communicate using XML.
  • JDBC 4.0 Support: It supports JDBC 4.0 for developing database-centric applications. As a result, programmers can leverage the various features of JDBC 4.0 such as the automatic loading of the JDBC driver class, connection management features, etc.
  • Annotation-based Programming: It allows programmers to define annotations (meta-tags) for various program elements so that the same can be used by the compiler or other tools to generate ready code whenever necessary
  • Dynamic Compilation: The Java Compiler API allows the dynamic compilation of Java source code from a running Java application.

Enhancements in Java SE 7

Some of the key enhancements in Java SE 7 :

  • Language Enhancements: Java SE 7 adds several language features aimed at helping programmers implement difficult functionality with ease. The new language features include strings in switch statements, multiple exception handling, diamond syntax, etc.
  • NIO 2.0: The new file system API (NIO 2.0) in Java SE 7 makes it a lot easier to work with file systems. It contains several enhancements to the standard file operations such as open, read, write, etc. In addition, it also allows programmers to create custom file systems.
  • Parallel Programming: Java SE 7 facilitates parallel programming through the use of the Fork/Join framework. While conventional multithreaded programming allowed programmers to use a single processor for multitasking; the Fork/Join framework enables programmers to make the best use of the available multiple processors through parallel programming.
  • Dynamic Language Support: Java SE 7 supports dynamically typed languages in the JVM. The invoke dynamic instruction is used to define customized linkage mechanisms for these languages.