Why has Java become so popular among application developers? Primarily because Java makes application developers more productive. It is a modern, robust, object-oriented language. Java’s unprecedented popularity stems from the following three benefits:
- Application Development Is Simpler - Java offers features such as support for networking, multithreading and automatic garbage collection that make application development simpler than most of its predecessors.
- Applications Are Platform Independent - The same Java binaries can run on any platform that supports a Java Virtual Machine, from embedded systems to mainframes. This reduces, if not completely eliminates, the task of porting applications.
- Applications Can Be Developed As Components - Java offers a component model, JavaBeans, that allows application developers to design and package components that can be assembled with components written by other application developers. Enterprise JavaBeans extend the component model for Java to server-side components. The JavaBeans component model enables the development of a robust market for plug-and-play software modules. This new application development model enables rapid assembly of applications that can be customized and deployed on any platform and adapted as a company’s business needs change.
The Java language is easier to understand (and write) than languages such as C and C++ because Java doesn't use pointers.
- and, to a lesser extent,java.util.concurrent and java.io.
- rt.jar contains all of the compiled class files for the base Java Runtime (“rt”)
Java is a safe language
And is therefore ideally suited for database integration. Because the database must be a safe environment and provide the foundation for several mission-critical applications, Oracle does not allow application code that could potentially compromise the integrity of the database to run inside the database. For example, Oracle does not permit application code written in “unsafe” languages like C or C++ to be executed in the same address space as the database. Although languages like C provide tremendous flexibility to application developers, they also have several pitfalls. Even experienced C and C++ programmers make these errors:
- Overwriting Array Boundaries - Because arrays and strings are manipulated as pointers, programmers inadvertently overwrite the boundaries of arrays and strings.
- Memory Leaks And Corruption - Memory allocation and deallocation is left to the programmer and results in a variety of programming problems, including memory corruption and memory leaks.
Any of these errors in an application can compromise the integrity of the database and halt missioncritical applications. In contrast, Java is a strongly-typed language and includes native support for arrays and strings and built-in support for memory management. The garbage collection mechanism built into the Java language frees application developers from allocating and deallocating memory, thereby eliminating problems of memory corruption and memory leaks.
Java is platform-independent
Apart from being a safe language, Java on the server offers many of the same benefits to application developers that it does on the client. Because Java is platform-independent, application logic developed in Java can easily be deployed on any server that supports Java. This enables true application partitioning in a multi-tier environment. Application programs written in Java can easily be migrated to another server without having to rewrite the application. Enterprises can leverage these benefits to improve time-to-market and lower system development and administration costs.
Client or a server environment
Java is a full-featured language whose expressive power is close to C. It can be used to develop any kind of applications in a client or a server environment.