Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

You state that object - oriented programming is a good thanks to manage giant pr

ID: 3886940 • Letter: Y

Question

You state that object - oriented programming is a good thanks to manage giant programs. However, it appears that it'd ad substantial overhead to comparatively tiny ones. Since you say that each one Java programs area unit, to some extent, object -oriented, will this impose a penalty for smaller programs? to handle the problems of movability and security, why was it necessary to form a replacement programming language like Java: could not a language like C++ be adapted? In different words, could not a C++ compiler that outputs computer memory unit code be created?

Explanation / Answer

a)Java compiled class file consists of several sections one of which corresponds to translated bytecode. The class file is like a container for this generated bytecode. The size of class file will be smaller for small programs and larger for large sized programs(in general). So while there is an overhead , iit is not significantly large for smaller programs.

b)Technically it is possible to compile c++ code to java bytecode to accomplish what has been suggested in the question. There is an existing compiler from NestedVM which compiles C++ to MIPS binary and then to java bytecode.

But Java compiler carries out language specific optimizations for java code which are not available in a cross compilation mechanism for C++ to java.

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote