One important difference between languages that provide syntax to encapsulate th
ID: 3794989 • Letter: O
Question
One important difference between languages that provide syntax to encapsulate the definition of user defined data types is whether the syntax requires the specification details to be separated from the implementation details. Ada requires such a separation. In Ada, the specification information must be placed in the package specification and the implementation details in the package body. Where must the representation details be placed?
Compare Ada with both C++ and Java in this regard. Take and defend a position as to whether requiring separation of the specification and representation information for a data type is a good language design decision.
Explanation / Answer
1 Ada and Java bid comparable Object-Oriented Programming support, but through quite different approaches in together their general philosophies and their specific features.
2 Each language allow the programmer to classify class inheritance hierarchies and to exploit encapsulation, polymorphism, and dynamic binding.Whereas OOP(Object oriented programming) forms the foundation of Java s semantic model, OOP in Ada is mostly orthogonal to the rest of the language.
3 In Java it is difficult to avoid using OOP; in Ada OOP is bring in only when explicitly indicate in the program.
4 Java is a pure OO language in the method of Smalltalk, with implicit pointers and implementation supplied garbage collection. Ada is a methodology-neutral OO language in the way of C++ , with explicit pointers and, in general, programmer-controlled against implementation-supplied storage reclamation.
5 Java use OOP to capture the functionality of generics ( templates ), exception handling, multi-threading & other facilities that are not necessarily related to object orientation. Ada supply particular feature for generic,exceptions, and tasking, independent of its OO model.
6 Java tend to provide greater plasticity with dynamic datastructures and a more conventional notation for OOP. Ada tends to offer more opportunities for optimization and run-time efficiency, and greater flexibility in the choice of programming style.
In brief, Java is an Object-Oriented language(oop) with feature for objects/classes, encapsulation and inheritance,polymorphism, and dynamic binding. Its outside syntax has a strong C and C++ accent: for example, the names of the primitive types and the forms for the control structures are based greatly on these language. Though, the OO model is more closely connected to so-called pure OO languages such as Smalltalk and Eiffel. Java directlysupport single inheritance and also offers a partial form of various inheritance through a feature known as an interface .
A key property of Java is that objects are manipulate indirectly, through implicit reference to explicitly allocated storage. The JVM performance performs automatic garbage collection, as a backdrop thread.One can use Java to write stand-alone program, known as application, in much the same way that one woulduse Ada, C++, or other language. Additionally, and a major cause for the attention that Java is currentlyattracting, one can use Java to write applets mechanism that are referenced from HTML pages, possibly
downloaded over the Internet, and execute by a browser or applet viewer on a client machine.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.