A Comparison of the Object-Oriented Features of Ada 95 and Java

Ada and Java offer comparable Object-Oriented Programming (“OOP”) support, but through quite different approaches in both their general philosophies and their specific features.

Each language allows the programmer to define class inheritance hierarchies and to exploit encapsulation, polymorphism, and dynamic binding. Whereas OOP forms the foundation of Java’s semantic model, OOP in Ada is largely orthogonal to the rest of the language. In Java it is difficult to avoid using OOP; in Ada OOP is brought in only when explicitly indicated in the program. Java is a “pure” OO language in the style of Smalltalk, with implicit pointers and implementation- supplied garbage collection. Ada is a methodology-neutral OO language in the manner of C++ , with explicit pointers and, in general, programmer-controlled versus implementation-supplied storage reclamation. Java uses OOP to capture the functionality of generics (“templates”), exception handling, multi-threading and other facilities that are not necessarily related to object orientation. Ada supplies specific features for generics, exceptions, and tasking, independent of its OO model. Java tends to provide greater flexibility with dynamic data structures and a more traditional notation for OOP. Ada tends to offer more opportunities for optimization and run-time efficiency, and greater flexibility in the choice of programming styles.