answersLogoWhite

0

Although Java is often described as a compiled language, it is a language that is both compiled and interpreted. Unlike C++ which typically compiles to native machine code, Java compiles to Java byte code, the native language of the Java virtual machine. The key difference here is that the Java virtual machine is not machine dependent, thus the same byte code can be executed upon any physical machine with a suitable Java virtual machine implementation; it is highly portable. Machine code can only be executed upon the machine architecture for which it was compiled. To support other architectures, the source code must be recompiled for those architectures.

In terms of execution, native machine code requires no further translation and can be executed as soon as the code is compiled successfully (including any and all shared libraries required by the executable). Java byte code requires that the Java virtual machine be memory-resident during execution as the byte code must be interpreted to produce native machine code while the byte code is executing within the virtual machine.

In terms of memory consumption, C++ programs require no additional memory over and above the program's requirements. Java programs require additional memory for the Java virtual machine runtime. Java programs also consume additional memory to assist in memory management, such as automatic garbage collection. C++ programs manage their own memory using resource handles and smart pointers; the use of a garbage collector is optional.

In terms of performance, C++ programs execute many times more quickly than equivalent Java programs due to Java's need to interpret the byte code.

User Avatar

Wiki User

8y ago

What else can I help you with?

Related Questions

What are the different kinds of program?

There are many different kinds of utility programs. Examples of the different kinds of utility programs includes ant-virus programs, time utility programs, and data compression programs.


What can be found on the online website known as Kids Running?

The website known as Kids Running offers all kinds of programs to help ones child embrace fitness, physical activity and exercise. The website also offers all kinds of products which can be bought from the website itself.


What are the kinds of java programs?

the two types of java programs are Applet and application programs


What kinds of running shoes will help me the most in competitive running?

If you are am a competitive runner, and only want the best running shoes. The kinds of running shoes will help me the most in competitive running is at Dicks sporting goods.


What are the differences between the different kinds of digital cameras?

The differences between the different kinds of digital cameras may include price, weight, quality, brand.


What kind of wedding programs are available?

The kinds of wedding programs that are available are numerous. These programs include tea-length programs, half-fold programs, rectangle programs, gate-fold programs, and square programs.


Kinds of locomotor?

walking,running,etc


What kinds of hair salon software is out there to make running a beauty salon easier?

Software such as Microsoft Office can help you run a small business like a salon. These includes programs like Word and Excel.


What the differences between the 3 kinds of maps?

thre all good


What types of wilderness programs are available in New England?

There are several different kinds of wilderness programs available in New England. There are recreational programs, therapeutic programs, conservation programs, team building programs, and educational programs available throughout the region.


What are three forms of running water?

Many kinds XD


When puerto ricans move to New York what kinds of differences do they find?

The language--