Friday, October 18, 2019
Programming Paradigms Comparison Essay Example | Topics and Well Written Essays - 2500 words
Programming Paradigms Comparison - Essay Example C++ supports multiple inheritance of method implementations from more than one superclass at a time. While it seems like a very useful feature, adding it to the language turns out to introduce many complexities. (2006a) The program compiled by a c++ compiler, is platform dependent. This means, a source file in C++ when compiled is converted into obj file, which contains machine codes and function calls for the built-in library functions. After this, the obj file is processed by the c++ linker utility, which patches the code of the library functions in order to resolve the library function calls and convert the obj file into exe file. More specifically this code patching is only for unregistered library functions, which are local to the C++ development environment. But when an external registered dll file is used in the source code, then the function calls in the obj file would not be resolved in the exe file and those function calls would be dynamically resolved at runtime of the executable file. C++ supports templates that allow you, for example, to implement a Stack and then instantiate it as Stack or Stack to produce two separate types: a stack of integers and a stack of floating point values. (2006a) C++ allows you to define operators that perform arbitrary operations on instances of your class. In effect, it allows extending the syntax of the language. This is a nifty feature, called operator overloading, tat makes for very elegant examples. (2006a) C++ has the ability to include preprocessor directive in the beginning of a program. (import file name from the library). Java possess the following characteristics: Java does not have any concept of pointers. The Java Runtime Environment by default reference the objects for the programmer. Java does not allow programmer to manipulate pointers or memory addresses of any kind and imposes certain restrictions in this respect (2006a): It does not allow casting object or arraying references into integers or vice versa. It does not allow you to do pointer arithmetic. It does not allow you to compute the size in bytes of any primitive type or object. Some of the reasons are: Pointers are a source of bugs. Eliminating them simplifies the language and eliminates many potential bugs (2006a). Pointers and pointer arithmetic could be used to sidestep Java's run-time checks and security mechanisms. Removing pointers allows Java to provide the security guarantees that it does (2006a). No Global Variables: In Java, every field and method is declared within a class and forms part of that class. The fields and methods of a
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.